aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar laurentlb <laurentlb@google.com>2017-10-16 17:02:42 +0200
committerGravatar Jakob Buchgraber <buchgr@google.com>2017-10-16 17:49:12 +0200
commit573a47ad80eb3553566087180d3f02149a2dc9f4 (patch)
tree5dd505f3548fbcf98caed1cf467a379ae2d815d8 /src/test/java/com/google/devtools
parent3d16add7bf4e5176f1d469c0c6addc5f1b8827ef (diff)
Move min/max tests to new test suite
RELNOTES: None. PiperOrigin-RevId: 172325367
Diffstat (limited to 'src/test/java/com/google/devtools')
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java108
1 files changed, 0 insertions, 108 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java b/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
index 0bc19519c6..e57d8c8f79 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
@@ -38,114 +38,6 @@ public class MethodLibraryTest extends EvaluationTestCase {
}
@Test
- public void testMinWithInvalidArgs() throws Exception {
- new SkylarkTest()
- .testIfExactError("type 'int' is not iterable", "min(1)")
- .testIfExactError("expected at least one item", "min([])");
- }
-
- @Test
- public void testMinWithString() throws Exception {
- new SkylarkTest()
- .testStatement("min('abcdefxyz')", "a")
- .testStatement("min('test', 'xyz')", "test");
- }
-
- @Test
- public void testMinWithList() throws Exception {
- new BothModesTest()
- .testEval("min([4, 5], [1])", "[1]")
- .testEval("min([1, 2], [3])", "[1, 2]")
- .testEval("min([1, 5], [1, 6], [2, 4], [0, 6])", "[0, 6]")
- .testStatement("min([-1])", -1)
- .testStatement("min([5, 2, 3])", 2);
- }
-
- @Test
- public void testMinWithDict() throws Exception {
- new BothModesTest().testStatement("min({1: 2, -1 : 3})", -1).testStatement("min({2: None})", 2);
- }
-
- @Test
- public void testMinWithSet() throws Exception {
- new BothModesTest()
- .testStatement("min(depset([-1]))", -1)
- .testStatement("min(depset([5, 2, 3]))", 2);
- }
-
- @Test
- public void testMinWithPositionalArguments() throws Exception {
- new BothModesTest().testStatement("min(-1, 2)", -1).testStatement("min(5, 2, 3)", 2);
- }
-
- @Test
- public void testMinWithSameValues() throws Exception {
- new BothModesTest()
- .testStatement("min(1, 1, 1, 1, 1, 1)", 1)
- .testStatement("min([1, 1, 1, 1, 1, 1])", 1);
- }
-
- @Test
- public void testMinWithDifferentTypes() throws Exception {
- new BothModesTest()
- .testIfExactError("Cannot compare int with string", "min(1, '2', True)")
- .testIfExactError("Cannot compare int with string", "min([1, '2', True])");
- }
-
- @Test
- public void testMaxWithInvalidArgs() throws Exception {
- new BothModesTest()
- .testIfExactError("type 'int' is not iterable", "max(1)")
- .testIfExactError("expected at least one item", "max([])");
- }
-
- @Test
- public void testMaxWithString() throws Exception {
- new BothModesTest()
- .testStatement("max('abcdefxyz')", "z")
- .testStatement("max('test', 'xyz')", "xyz");
- }
-
- @Test
- public void testMaxWithList() throws Exception {
- new BothModesTest()
- .testEval("max([1, 2], [5])", "[5]")
- .testStatement("max([-1])", -1)
- .testStatement("max([5, 2, 3])", 5);
- }
-
- @Test
- public void testMaxWithDict() throws Exception {
- new BothModesTest().testStatement("max({1: 2, -1 : 3})", 1).testStatement("max({2: None})", 2);
- }
-
- @Test
- public void testMaxWithSet() throws Exception {
- new BothModesTest()
- .testStatement("max(depset([-1]))", -1)
- .testStatement("max(depset([5, 2, 3]))", 5);
- }
-
- @Test
- public void testMaxWithPositionalArguments() throws Exception {
- new BothModesTest().testStatement("max(-1, 2)", 2).testStatement("max(5, 2, 3)", 5);
- }
-
- @Test
- public void testMaxWithSameValues() throws Exception {
- new BothModesTest()
- .testStatement("max(1, 1, 1, 1, 1, 1)", 1)
- .testStatement("max([1, 1, 1, 1, 1, 1])", 1);
- }
-
- @Test
- public void testMaxWithDifferentTypes() throws Exception {
- new BothModesTest()
- .testIfExactError("Cannot compare int with string", "max(1, '2', True)")
- .testIfExactError("Cannot compare int with string", "max([1, '2', True])");
- }
-
- @Test
public void testSplitLines_EmptyLine() throws Exception {
new BothModesTest().testEval("''.splitlines()", "[]").testEval("'\\n'.splitlines()", "['']");
}