@@ -30,7 +30,7 @@ void testLoad() throws IOException, URISyntaxException {
3030 "everywhere " ,
3131 "value" ,
3232 "one two three" ,
33- "\u1234 " );
33+ "\u1234 \u1234 " );
3434 assertThat (p .rawValues ())
3535 .containsExactly (
3636 "simple" ,
@@ -39,7 +39,7 @@ void testLoad() throws IOException, URISyntaxException {
3939 "everywhere " ,
4040 "value" ,
4141 "one \\ \n two \\ \n \t three" ,
42- "\\ u1234" );
42+ "\\ u1234\u1234 " );
4343 }
4444
4545 @ Test
@@ -69,7 +69,7 @@ void testGet() throws IOException, URISyntaxException {
6969 assertThat (p .get (" with spaces" )).isEqualTo ("everywhere " );
7070 assertThat (p .get ("altsep" )).isEqualTo ("value" );
7171 assertThat (p .get ("multiline" )).isEqualTo ("one two three" );
72- assertThat (p .get ("key.4" )).isEqualTo ("\u1234 " );
72+ assertThat (p .get ("key.4" )).isEqualTo ("\u1234 \u1234 " );
7373 }
7474
7575 @ Test
@@ -102,7 +102,7 @@ void testGetProperty() throws IOException, URISyntaxException {
102102 assertThat (p .getProperty (" with spaces" )).isEqualTo ("everywhere " );
103103 assertThat (p .getProperty ("altsep" )).isEqualTo ("" );
104104 assertThat (p .getProperty ("multiline" )).isEqualTo ("one two three" );
105- assertThat (p .getProperty ("key.4" )).isEqualTo ("\u1234 " );
105+ assertThat (p .getProperty ("key.4" )).isEqualTo ("\u1234 \u1234 " );
106106 assertThat (p .getProperty ("five" )).isEqualTo ("5" );
107107 assertThat (p .getPropertyComment ("five" )).containsExactly ("# a new comment" );
108108 StringWriter sw = new StringWriter ();
@@ -119,7 +119,7 @@ void testGetRaw() throws IOException, URISyntaxException {
119119 assertThat (p .getRaw (" with spaces" )).isEqualTo ("everywhere " );
120120 assertThat (p .getRaw ("altsep" )).isEqualTo ("value" );
121121 assertThat (p .getRaw ("multiline" )).isEqualTo ("one \\ \n two \\ \n \t three" );
122- assertThat (p .getRaw ("key.4" )).isEqualTo ("\\ u1234" );
122+ assertThat (p .getRaw ("key.4" )).isEqualTo ("\\ u1234\u1234 " );
123123 }
124124
125125 @ Test
@@ -154,7 +154,7 @@ void testPut() throws IOException, URISyntaxException {
154154 p .put (" with spaces" , "everywhere " );
155155 p .put ("altsep" , "value" );
156156 p .put ("multiline" , "one two three" );
157- p .put ("key.4" , "\u1234 " );
157+ p .put ("key.4" , "\u1234 \u1234 " );
158158 assertThat (p ).size ().isEqualTo (7 );
159159 assertThat (p .keySet ())
160160 .containsExactly (
@@ -170,7 +170,7 @@ void testPut() throws IOException, URISyntaxException {
170170 "everywhere " ,
171171 "value" ,
172172 "one two three" ,
173- "\u1234 " );
173+ "\u1234 \u1234 " );
174174 assertThat (p .rawValues ())
175175 .containsExactly (
176176 "simple" ,
@@ -179,7 +179,7 @@ void testPut() throws IOException, URISyntaxException {
179179 "everywhere " ,
180180 "value" ,
181181 "one two three" ,
182- "\\ u1234" );
182+ "\u1234 \u1234 " );
183183 StringWriter sw = new StringWriter ();
184184 p .store (sw );
185185 assertThat (sw .toString ()).isEqualTo (readAll (getResource ("/test-put.properties" )));
@@ -195,7 +195,7 @@ void testSetProperty() throws IOException, URISyntaxException {
195195 p .setProperty (" with spaces" , "everywhere " );
196196 p .setProperty ("altsep" , "value" );
197197 p .setProperty ("multiline" , "one two three" );
198- p .setProperty ("key.4" , "\u1234 " );
198+ p .setProperty ("key.4" , "\u1234 \u1234 " );
199199 StringWriter sw = new StringWriter ();
200200 p .store (sw );
201201 assertThat (sw .toString ()).isEqualTo (readAll (getResource ("/test-setproperty.properties" )));
@@ -210,7 +210,7 @@ void testPutRaw() throws IOException, URISyntaxException {
210210 p .putRaw ("\\ with\\ spaces" , "everywhere " );
211211 p .putRaw ("altsep" , "value" );
212212 p .putRaw ("multiline" , "one \\ \n two \\ \n \t three" );
213- p .putRaw ("key.4" , "\\ u1234" );
213+ p .putRaw ("key.4" , "\\ u1234\u1234 " );
214214 assertThat (p ).size ().isEqualTo (7 );
215215 assertThat (p .keySet ())
216216 .containsExactly (
@@ -226,7 +226,7 @@ void testPutRaw() throws IOException, URISyntaxException {
226226 "everywhere " ,
227227 "value" ,
228228 "one two three" ,
229- "\u1234 " );
229+ "\u1234 \u1234 " );
230230 assertThat (p .rawValues ())
231231 .containsExactly (
232232 "simple" ,
@@ -235,7 +235,7 @@ void testPutRaw() throws IOException, URISyntaxException {
235235 "everywhere " ,
236236 "value" ,
237237 "one \\ \n two \\ \n \t three" ,
238- "\\ u1234" );
238+ "\\ u1234\u1234 " );
239239 StringWriter sw = new StringWriter ();
240240 p .store (sw );
241241 assertThat (sw .toString ()).isEqualTo (readAll (getResource ("/test-putraw.properties" )));
@@ -330,7 +330,8 @@ void testPutNull() throws IOException, URISyntaxException {
330330 @ Test
331331 void testPutUnicode () throws IOException , URISyntaxException {
332332 Properties p = new Properties ();
333- p .put ("test" , "الألبانية" );
333+ p .putRaw ("encoded" , "\\ u0627\\ u0644\\ u0623\\ u0644\\ u0628\\ u0627\\ u0646\\ u064a\\ u0629" );
334+ p .put ("text" , "\u0627 \u0644 \u0623 \u0644 \u0628 \u0627 \u0646 \u064a \u0629 " );
334335 StringWriter sw = new StringWriter ();
335336 p .store (sw );
336337 assertThat (sw .toString ())
@@ -431,7 +432,7 @@ public void testInteropLoad() throws IOException, URISyntaxException {
431432 "everywhere " ,
432433 "value" ,
433434 "one two three" ,
434- "\u1234 " );
435+ "\u1234 \u1234 " );
435436 }
436437
437438 @ Test
@@ -445,7 +446,7 @@ void testInteropStore() throws IOException, URISyntaxException {
445446 assertThat (sw .toString ()).contains ("\\ with\\ spaces=everywhere \n " );
446447 assertThat (sw .toString ()).contains ("altsep=value\n " );
447448 assertThat (sw .toString ()).contains ("multiline=one two three\n " );
448- assertThat (sw .toString ()).contains ("key.4=\u1234 \n " );
449+ assertThat (sw .toString ()).contains ("key.4=\u1234 \u1234 \ n " );
449450 }
450451
451452 @ Test
0 commit comments