Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,40 @@
@NullUnmarked
public class CharsetsTest extends TestCase {

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testUsAscii() {
assertThat(Charsets.US_ASCII).isEqualTo(Charset.forName("US-ASCII"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testIso88591() {
assertThat(Charsets.ISO_8859_1).isEqualTo(Charset.forName("ISO-8859-1"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
public void testUtf8() {
assertThat(Charsets.UTF_8).isEqualTo(Charset.forName("UTF-8"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testUtf16be() {
assertThat(Charsets.UTF_16BE).isEqualTo(Charset.forName("UTF-16BE"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testUtf16le() {
assertThat(Charsets.UTF_16LE).isEqualTo(Charset.forName("UTF-16LE"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testUtf16() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ public void testExhaustive() {
.add(Range.open(19, 20))
.build();

@SuppressWarnings("TruthConstantAsserts") // We are testing our implementation of `union`.
public void testUnion() {
RangeSet<Integer> expected =
ImmutableRangeSet.<Integer>builder()
Expand All @@ -461,6 +462,7 @@ public void testUnion() {
assertThat(RANGE_SET_ONE.union(RANGE_SET_TWO)).isEqualTo(expected);
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our implementation of `intersection`.
public void testIntersection() {
RangeSet<Integer> expected =
ImmutableRangeSet.<Integer>builder()
Expand All @@ -472,6 +474,7 @@ public void testIntersection() {
assertThat(RANGE_SET_ONE.intersection(RANGE_SET_TWO)).isEqualTo(expected);
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our implementation of `difference`.
public void testDifference() {
RangeSet<Integer> expected =
ImmutableRangeSet.<Integer>builder()
Expand Down
6 changes: 6 additions & 0 deletions guava-tests/test/com/google/common/base/CharsetsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,40 @@
@NullUnmarked
public class CharsetsTest extends TestCase {

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testUsAscii() {
assertThat(Charsets.US_ASCII).isEqualTo(Charset.forName("US-ASCII"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testIso88591() {
assertThat(Charsets.ISO_8859_1).isEqualTo(Charset.forName("ISO-8859-1"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
public void testUtf8() {
assertThat(Charsets.UTF_8).isEqualTo(Charset.forName("UTF-8"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testUtf16be() {
assertThat(Charsets.UTF_16BE).isEqualTo(Charset.forName("UTF-16BE"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testUtf16le() {
assertThat(Charsets.UTF_16LE).isEqualTo(Charset.forName("UTF-16LE"));
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our constant definition.
@J2ktIncompatible
@GwtIncompatible // Non-UTF-8 Charset
public void testUtf16() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ public void testExhaustive() {
.add(Range.open(19, 20))
.build();

@SuppressWarnings("TruthConstantAsserts") // We are testing our implementation of `union`.
public void testUnion() {
RangeSet<Integer> expected =
ImmutableRangeSet.<Integer>builder()
Expand All @@ -462,6 +463,7 @@ public void testUnion() {
assertThat(RANGE_SET_ONE.union(RANGE_SET_TWO)).isEqualTo(expected);
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our implementation of `intersection`.
public void testIntersection() {
RangeSet<Integer> expected =
ImmutableRangeSet.<Integer>builder()
Expand All @@ -473,6 +475,7 @@ public void testIntersection() {
assertThat(RANGE_SET_ONE.intersection(RANGE_SET_TWO)).isEqualTo(expected);
}

@SuppressWarnings("TruthConstantAsserts") // We are testing our implementation of `difference`.
public void testDifference() {
RangeSet<Integer> expected =
ImmutableRangeSet.<Integer>builder()
Expand Down
Loading