use of com.google.auto.value.annotations.StringValues in project auto by google.
the class AutoAnnotationTest method testSimpleVarArgs.
@Test
public void testSimpleVarArgs() {
StringValues expectedStringValues = AnnotatedClass.class.getAnnotation(StringValues.class);
StringValues actualStringValues = newStringValuesVarArgs("oops");
StringValues otherStringValues = newStringValuesVarArgs(new String[] {});
new EqualsTester().addEqualityGroup(expectedStringValues, actualStringValues).addEqualityGroup(otherStringValues).testEquals();
}
use of com.google.auto.value.annotations.StringValues in project auto by google.
the class AutoAnnotationTest method testStringQuoting.
@Test
public void testStringQuoting() {
StringValues instance = newStringValues(new String[] { "", "\r\n", "hello, world", "Éamonn", "\007" });
String expected = "@com.google.auto.value.annotations.StringValues(" + "[\"\", \"\\r\\n\", \"hello, world\", \"Éamonn\", \"\\007\\uffef\"])";
assertEquals(expected, instance.toString());
}
use of com.google.auto.value.annotations.StringValues in project auto by google.
the class AutoAnnotationTest method testSimple.
@Test
public void testSimple() {
StringValues expectedStringValues = AnnotatedClass.class.getAnnotation(StringValues.class);
StringValues actualStringValues = newStringValues(new String[] { "oops" });
StringValues otherStringValues = newStringValues(new String[] {});
new EqualsTester().addEqualityGroup(expectedStringValues, actualStringValues).addEqualityGroup(otherStringValues).testEquals();
}
use of com.google.auto.value.annotations.StringValues in project auto by google.
the class AutoAnnotationTest method testArraysAreCloned.
@Test
public void testArraysAreCloned() {
String[] array = { "Jekyll" };
StringValues stringValues = newStringValues(array);
array[0] = "Hyde";
assertEquals("Jekyll", stringValues.value()[0]);
stringValues.value()[0] = "Hyde";
assertEquals("Jekyll", stringValues.value()[0]);
}
Aggregations