aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/syntax
diff options
context:
space:
mode:
authorGravatar Vladimir Moskva <vladmos@google.com>2017-02-22 23:57:49 +0000
committerGravatar Yue Gan <yueg@google.com>2017-02-23 11:31:54 +0000
commitf2eacf021097c38154820c05e9ae6aeb01883ecc (patch)
tree8eb8a0673ce6951fdcfe0fff31053b97c4509176 /src/test/java/com/google/devtools/build/lib/syntax
parent95dac7050d0d7f0cd2a4c7fad1859daceed556af (diff)
str.partition and str.rpartition return tuples instead of lists
-- PiperOrigin-RevId: 148281228 MOS_MIGRATED_REVID=148281228
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/syntax')
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java52
1 files changed, 26 insertions, 26 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 55867c6d1b..fb9c5cccc4 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
@@ -628,24 +628,24 @@ public class MethodLibraryTest extends EvaluationTestCase {
@Test
public void testPyStringPartitionEasy() throws Exception {
new BothModesTest()
- .testEval("'lawl'.partition('a')", "['l', 'a', 'wl']")
- .testEval("'lawl'.rpartition('a')", "['l', 'a', 'wl']");
+ .testEval("'lawl'.partition('a')", "('l', 'a', 'wl')")
+ .testEval("'lawl'.rpartition('a')", "('l', 'a', 'wl')");
}
@Test
public void testPyStringPartitionMultipleSep() throws Exception {
new BothModesTest()
- .testEval("'google'.partition('o')", "['g', 'o', 'ogle']")
- .testEval("'google'.rpartition('o')", "['go', 'o', 'gle']")
- .testEval("'xxx'.partition('x')", "['', 'x', 'xx']")
- .testEval("'xxx'.rpartition('x')", "['xx', 'x', '']");
+ .testEval("'google'.partition('o')", "('g', 'o', 'ogle')")
+ .testEval("'google'.rpartition('o')", "('go', 'o', 'gle')")
+ .testEval("'xxx'.partition('x')", "('', 'x', 'xx')")
+ .testEval("'xxx'.rpartition('x')", "('xx', 'x', '')");
}
@Test
public void testPyStringPartitionEmptyInput() throws Exception {
new BothModesTest()
- .testEval("''.partition('a')", "['', '', '']")
- .testEval("''.rpartition('a')", "['', '', '']");
+ .testEval("''.partition('a')", "('', '', '')")
+ .testEval("''.rpartition('a')", "('', '', '')");
}
@Test
@@ -658,47 +658,47 @@ public class MethodLibraryTest extends EvaluationTestCase {
@Test
public void testPyStringPartitionDefaultSep() throws Exception {
new BothModesTest()
- .testEval("'hi this is a test'.partition()", "['hi', ' ', 'this is a test']")
- .testEval("'hi this is a test'.rpartition()", "['hi this is a', ' ', 'test']")
- .testEval("'google'.partition()", "['google', '', '']")
- .testEval("'google'.rpartition()", "['', '', 'google']");
+ .testEval("'hi this is a test'.partition()", "('hi', ' ', 'this is a test')")
+ .testEval("'hi this is a test'.rpartition()", "('hi this is a', ' ', 'test')")
+ .testEval("'google'.partition()", "('google', '', '')")
+ .testEval("'google'.rpartition()", "('', '', 'google')");
}
@Test
public void testPyStringPartitionNoMatch() throws Exception {
new BothModesTest()
- .testEval("'google'.partition('x')", "['google', '', '']")
- .testEval("'google'.rpartition('x')", "['', '', 'google']");
+ .testEval("'google'.partition('x')", "('google', '', '')")
+ .testEval("'google'.rpartition('x')", "('', '', 'google')");
}
@Test
public void testPyStringPartitionWordBoundaries() throws Exception {
new BothModesTest()
- .testEval("'goog'.partition('g')", "['', 'g', 'oog']")
- .testEval("'goog'.rpartition('g')", "['goo', 'g', '']")
- .testEval("'plex'.partition('p')", "['', 'p', 'lex']")
- .testEval("'plex'.rpartition('p')", "['', 'p', 'lex']")
- .testEval("'plex'.partition('x')", "['ple', 'x', '']")
- .testEval("'plex'.rpartition('x')", "['ple', 'x', '']");
+ .testEval("'goog'.partition('g')", "('', 'g', 'oog')")
+ .testEval("'goog'.rpartition('g')", "('goo', 'g', '')")
+ .testEval("'plex'.partition('p')", "('', 'p', 'lex')")
+ .testEval("'plex'.rpartition('p')", "('', 'p', 'lex')")
+ .testEval("'plex'.partition('x')", "('ple', 'x', '')")
+ .testEval("'plex'.rpartition('x')", "('ple', 'x', '')");
}
@Test
public void testPyStringPartitionLongSep() throws Exception {
new BothModesTest()
- .testEval("'google'.partition('oog')", "['g', 'oog', 'le']")
- .testEval("'google'.rpartition('oog')", "['g', 'oog', 'le']")
+ .testEval("'google'.partition('oog')", "('g', 'oog', 'le')")
+ .testEval("'google'.rpartition('oog')", "('g', 'oog', 'le')")
.testEval(
- "'lolgooglolgooglolgooglol'.partition('goog')", "['lol', 'goog', 'lolgooglolgooglol']")
+ "'lolgooglolgooglolgooglol'.partition('goog')", "('lol', 'goog', 'lolgooglolgooglol')")
.testEval(
"'lolgooglolgooglolgooglol'.rpartition('goog')",
- "['lolgooglolgooglol', 'goog', 'lol']");
+ "('lolgooglolgooglol', 'goog', 'lol')");
}
@Test
public void testPyStringPartitionCompleteString() throws Exception {
new BothModesTest()
- .testEval("'google'.partition('google')", "['', 'google', '']")
- .testEval("'google'.rpartition('google')", "['', 'google', '']");
+ .testEval("'google'.partition('google')", "('', 'google', '')")
+ .testEval("'google'.rpartition('google')", "('', 'google', '')");
}
@Test