@@ -11,13 +11,15 @@ class MultipleStringLiteralsCheckTest extends CheckTestCase<MultipleStringLitera
1111 assertNoMsg (check , SINGLE_CHARS );
1212 assertNoMsg (check , THREE_SPACE );
1313 assertNoMsg (check , OBJECT_FIELD_KEYS_ISSUE_116 );
14+ assertNoMsg (check , SUPPRESSION );
1415 }
1516
1617 public function testMultipleStringLiterals () {
1718 var check = new MultipleStringLiteralsCheck ();
1819 assertMsg (check , THREE_XML , ' String "xml" appears 3 times in the file' );
1920 assertMsg (check , THREE_XML_SWITCH , ' String "xml" appears 3 times in the file' );
20- assertMsg (check , OBJECT_FIELD_VALUES_ISSUE_116 , ' String "duplicate" appears 9 times in the file' );
21+ assertMsg (check , OBJECT_FIELD_VALUES_ISSUE_116 , ' String "duplicate" appears 4 times in the file' );
22+ assertMsg (check , EXAGGERATION_ISSUE_318 , ' String "user.name" appears 3 times in the file' );
2123 }
2224
2325 public function testIgnoreRegEx () {
@@ -32,8 +34,8 @@ class MultipleStringLiteralsCheckTest extends CheckTestCase<MultipleStringLitera
3234 check .allowDuplicates = 1 ;
3335 assertNoMsg (check , INTERPOLATION_ISSUE_109 );
3436 #if (haxeparser < "3.3.0")
35- assertMsg (check , NO_INTERPOLATION_ISSUE_109 , ' String "value $$$$ is i" appears 12 times in the file' );
36- assertMsg (check , NO_INTERPOLATION_AT_START_ISSUE_109 , ' String "$$$$ is i" appears 6 times in the file' );
37+ assertMsg (check , NO_INTERPOLATION_ISSUE_109 , ' String "value $$$$ is i" appears 2 times in the file' );
38+ assertMsg (check , NO_INTERPOLATION_AT_START_ISSUE_109 , ' String "$$$$ is i" appears 2 times in the file' );
3739 #end
3840 }
3941}
@@ -158,4 +160,25 @@ abstract MultipleStringLiteralsCheckTests(String) to String {
158160 trace('$$is i');
159161 }
160162 }" ;
163+
164+ var EXAGGERATION_ISSUE_318 = "
165+ class Test {
166+ function foo() {
167+ name = new Value<String>(System.storage.get('user.name'), function(to, _) System.storage.set('user.name', to));
168+ }
169+ function clear() {
170+ System.storage.remove('user.name');
171+ }
172+ }" ;
173+
174+ var SUPPRESSION = "
175+ class Test {
176+ function foo() {
177+ name = new Value<String>(System.storage.get('user.name'), function(to, _) System.storage.set('user.name', to));
178+ }
179+ @SuppressWarnings('checkstyle:MultipleStringLiterals')
180+ function clear() {
181+ System.storage.remove('user.name');
182+ }
183+ }" ;
161184}
0 commit comments