Permalink
Browse files

Change Range.toString() to use printable ASCII chars (..) instead of …

…\u2025 (‥)

See #2376
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=114820315
  • Loading branch information...
kluever authored and cpovirk committed Feb 17, 2016
1 parent 31c5a40 commit c6e21a35f3113a7a952a9615a0e92dcf1dd4bfb3
@@ -51,7 +51,7 @@ public void testOpen() {
assertEquals(8, (int) range.upperEndpoint());
assertEquals(OPEN, range.upperBoundType());
assertFalse(range.isEmpty());
assertEquals("(4\u20258)", range.toString());
assertEquals("(4..8)", range.toString());
reserializeAndAssert(range);
}
@@ -78,7 +78,7 @@ public void testClosed() {
assertEquals(7, (int) range.upperEndpoint());
assertEquals(CLOSED, range.upperBoundType());
assertFalse(range.isEmpty());
assertEquals("[5\u20257]", range.toString());
assertEquals("[5..7]", range.toString());
reserializeAndAssert(range);
}
@@ -100,7 +100,7 @@ public void testOpenClosed() {
assertEquals(7, (int) range.upperEndpoint());
assertEquals(CLOSED, range.upperBoundType());
assertFalse(range.isEmpty());
assertEquals("(4\u20257]", range.toString());
assertEquals("(4..7]", range.toString());
reserializeAndAssert(range);
}
@@ -114,7 +114,7 @@ public void testClosedOpen() {
assertEquals(8, (int) range.upperEndpoint());
assertEquals(OPEN, range.upperBoundType());
assertFalse(range.isEmpty());
assertEquals("[5\u20258)", range.toString());
assertEquals("[5..8)", range.toString());
reserializeAndAssert(range);
}
@@ -147,7 +147,7 @@ public void testSingleton() {
assertEquals(4, (int) range.upperEndpoint());
assertEquals(CLOSED, range.upperBoundType());
assertFalse(range.isEmpty());
assertEquals("[4\u20254]", range.toString());
assertEquals("[4..4]", range.toString());
reserializeAndAssert(range);
}
@@ -163,7 +163,7 @@ public void testEmpty1() {
assertEquals(4, (int) range.upperEndpoint());
assertEquals(OPEN, range.upperBoundType());
assertTrue(range.isEmpty());
assertEquals("[4\u20254)", range.toString());
assertEquals("[4..4)", range.toString());
reserializeAndAssert(range);
}
@@ -179,7 +179,7 @@ public void testEmpty2() {
assertEquals(4, (int) range.upperEndpoint());
assertEquals(CLOSED, range.upperBoundType());
assertTrue(range.isEmpty());
assertEquals("(4\u20254]", range.toString());
assertEquals("(4..4]", range.toString());
reserializeAndAssert(range);
}
@@ -193,7 +193,7 @@ public void testLessThan() {
assertEquals(5, (int) range.upperEndpoint());
assertEquals(OPEN, range.upperBoundType());
assertFalse(range.isEmpty());
assertEquals("(-\u221e\u20255)", range.toString());
assertEquals("(-\u221e..5)", range.toString());
reserializeAndAssert(range);
}
@@ -207,7 +207,7 @@ public void testGreaterThan() {
assertEquals(OPEN, range.lowerBoundType());
assertUnboundedAbove(range);
assertFalse(range.isEmpty());
assertEquals("(5\u2025+\u221e)", range.toString());
assertEquals("(5..+\u221e)", range.toString());
reserializeAndAssert(range);
}
@@ -221,7 +221,7 @@ public void testAtLeast() {
assertEquals(CLOSED, range.lowerBoundType());
assertUnboundedAbove(range);
assertFalse(range.isEmpty());
assertEquals("[6\u2025+\u221e)", range.toString());
assertEquals("[6..+\u221e)", range.toString());
reserializeAndAssert(range);
}
@@ -235,7 +235,7 @@ public void testAtMost() {
assertEquals(4, (int) range.upperEndpoint());
assertEquals(CLOSED, range.upperBoundType());
assertFalse(range.isEmpty());
assertEquals("(-\u221e\u20254]", range.toString());
assertEquals("(-\u221e..4]", range.toString());
reserializeAndAssert(range);
}
@@ -246,7 +246,7 @@ public void testAll() {
assertUnboundedBelow(range);
assertUnboundedAbove(range);
assertFalse(range.isEmpty());
assertEquals("(-\u221e\u2025+\u221e)", range.toString());
assertEquals("(-\u221e..+\u221e)", range.toString());
assertSame(range, reserializeAndAssert(range));
assertSame(range, Range.all());
}
@@ -649,7 +649,7 @@ public String toString() {
private static String toString(Cut<?> lowerBound, Cut<?> upperBound) {
StringBuilder sb = new StringBuilder(16);
lowerBound.describeAsLowerBound(sb);
sb.append('\u2025');
sb.append("..");
upperBound.describeAsUpperBound(sb);
return sb.toString();
}
@@ -119,7 +119,7 @@
* Returns a view of the part of this range map that intersects with {@code range}.
*
* <p>For example, if {@code rangeMap} had the entries
* {@code [1, 5] => "foo", (6, 8) => "bar", (10, \u2025) => "baz"}
* {@code [1, 5] => "foo", (6, 8) => "bar", (10, ) => "baz"}
* then {@code rangeMap.subRangeMap(Range.open(3, 12))} would return a range map
* with the entries {@code (3, 5) => "foo", (6, 8) => "bar", (10, 12) => "baz"}.
*
@@ -224,7 +224,7 @@
/**
* Returns a readable string representation of this range set. For example, if this
* {@code RangeSet} consisted of {@code Range.closed(1, 3)} and {@code Range.greaterThan(4)},
* this might return {@code " [13](4+∞)}"}.
* this might return {@code " [1..3](4..+∞)}"}.
*/
@Override
String toString();

0 comments on commit c6e21a3

Please sign in to comment.