1818
1919import static com .google .common .truth .Truth .assertThat ;
2020
21- import com .google .common .base .Joiner ;
2221import com .google .template .soy .SoyFileSetParser .ParseResult ;
2322import com .google .template .soy .base .SourceFilePath ;
2423import com .google .template .soy .base .internal .SoyFileSupplier ;
@@ -37,32 +36,28 @@ public void externOnlyDuplicateNamespace_reportsError() {
3736 ParseResult unused =
3837 SoyFileSetParserBuilder .forSuppliers (
3938 SoyFileSupplier .Factory .create (
40- Joiner . on ( " \n " )
41- . join (
42- "{namespace my.duplicate.namespace.testing}" ,
43- "{ template t}" ,
44- "{/template}" ) ,
39+ """
40+ {namespace my.duplicate.namespace.testing}
41+ {template t}
42+ {/ template}\
43+ """ ,
4544 SourceFilePath .forTest ("file1.soy" )),
4645 SoyFileSupplier .Factory .create (
47- Joiner . on ( " \n " )
48- . join (
49- "{namespace my.duplicate.namespace.testing}" ,
50- "{extern myExtern: (s: string) => string}" ,
51- " {jsimpl namespace= \" goog.string \" function= \" capitalize \" /}" ,
52- "{/extern}" ) ,
46+ """
47+ {namespace my.duplicate.namespace.testing}
48+ {extern myExtern: (s: string) => string}
49+ {jsimpl namespace="goog. string" function="capitalize" /}
50+ {/extern}\
51+ """ ,
5352 SourceFilePath .forTest ("file2.soy" )))
5453 .errorReporter (errorReporter )
5554 .build ()
5655 .parse ();
5756
5857 assertThat (errorReporter .getErrors ()).hasSize (2 );
5958 assertThat (errorReporter .getErrors ().get (0 ).message ())
60- .isEqualTo (
61- "Found another file 'file2.soy' with the same namespace. All files must have unique"
62- + " namespaces." );
59+ .isEqualTo ("Namespace collision with: 'file2.soy'. All files must have unique namespaces." );
6360 assertThat (errorReporter .getErrors ().get (1 ).message ())
64- .isEqualTo (
65- "Found another file 'file1.soy' with the same namespace. All files must have unique"
66- + " namespaces." );
61+ .isEqualTo ("Namespace collision with: 'file1.soy'. All files must have unique namespaces." );
6762 }
6863}
0 commit comments