@@ -67,6 +67,7 @@ class StringsFileUpdaterTests: XCTestCase {
6767 ( " cHL-Zc-L39.normalTitle " , " Example Button 3 " , " Class = \" UIButton \" ; normalTitle = \" Example Button 3 \" ; ObjectID = \" cHL-Zc-L39 \" ; " ) ,
6868 ( " test.key " , " This is a test key " , " Completely custom comment structure in one line " ) ,
6969 ( " test.key.ignored " , " This is a test key to be ignored #bc-ignore! " , " Completely custom comment structure in one line to be ignored " ) ,
70+ ( " test.key.ignoreEmptyStrings " , " " , " This key should be ignored when ignoreEmptyKeys is set " ) ,
7071 ( " abc-12-345.normalTitle " , " 😀 " , " Class = \" UIButton \" ; normalTitle = \" 😀 \" ; ObjectID = \" abc-12-345 \" ; " ) ,
7172 ( " em1-3S-vgp.text " , " Refrakční vzdálenost v metrech " ,
7273 " Class = \" UILabel \" ; text = \" Refraktionsentfernung in Meter \" ; ObjectID = \" em1-3S-vgp \" ; " )
@@ -120,6 +121,8 @@ class StringsFileUpdaterTests: XCTestCase {
120121 " \" test.key \" = \" This is a test key \" ; " , " " ,
121122 " /* Completely custom comment structure in one line to be ignored */" ,
122123 " \" test.key.ignored \" = \" This is a test key to be ignored #bc-ignore! \" ; " , " " ,
124+ " /* This key should be ignored when ignoreEmptyKeys is set */" ,
125+ " \" test.key.ignoreEmptyStrings \" = \" \" ; " , " " ,
123126 " /* Class = \"UIButton\"; normalTitle = \"😀\"; ObjectID = \"abc-12-345\"; */" ,
124127 " \" abc-12-345.normalTitle \" = \" 😀 \" ; " , " " ,
125128 " /* Class = \"UILabel\"; text = \"Refraktionsentfernung in Meter\"; ObjectID = \"em1-3S-vgp\"; */" ,
@@ -133,7 +136,7 @@ class StringsFileUpdaterTests: XCTestCase {
133136 XCTAssertEqual ( oldLinesInFile [ index] , expectedLine)
134137 }
135138
136- stringsFileUpdater. incrementallyUpdateKeys ( withStringsFileAtPath: newStringsFilePath, addNewValuesAsEmpty: true , updateCommentWithBase: false )
139+ stringsFileUpdater. incrementallyUpdateKeys ( withStringsFileAtPath: newStringsFilePath, addNewValuesAsEmpty: true , updateCommentWithBase: false , ignoreEmptyStrings : true )
137140
138141 let expectedLinesAfterIncrementalUpdate = [
139142 " " , " /* Class = \"UIButton\"; normalTitle = \"Example Button 1\"; ObjectID = \"35F-cl-mdI\"; */" ,
@@ -180,6 +183,8 @@ class StringsFileUpdaterTests: XCTestCase {
180183 " \" test.key \" = \" This is a test key \" ; " , " " ,
181184 " /* Completely custom comment structure in one line to be ignored */" ,
182185 " \" test.key.ignored \" = \" This is a test key to be ignored #bc-ignore! \" ; " , " " ,
186+ " /* This key should be ignored when ignoreEmptyKeys is set */" ,
187+ " \" test.key.ignoreEmptyStrings \" = \" \" ; " , " " ,
183188 " /* Class = \"UIButton\"; normalTitle = \"😀\"; ObjectID = \"abc-12-345\"; */" ,
184189 " \" abc-12-345.normalTitle \" = \" 😀 \" ; " , " " ,
185190 " /* Class = \"UILabel\"; text = \"Refraktionsentfernung in Meter\"; ObjectID = \"em1-3S-vgp\"; */" ,
@@ -197,7 +202,8 @@ class StringsFileUpdaterTests: XCTestCase {
197202 withStringsFileAtPath: newStringsFilePath,
198203 addNewValuesAsEmpty: true ,
199204 updateCommentWithBase: false ,
200- keepWhitespaceSurroundings: true
205+ keepWhitespaceSurroundings: true ,
206+ ignoreEmptyStrings: true
201207 )
202208
203209 let expectedLinesAfterIncrementalUpdate = [
@@ -245,6 +251,8 @@ class StringsFileUpdaterTests: XCTestCase {
245251 " \" test.key \" = \" This is a test key \" ; " , " " ,
246252 " /* Completely custom comment structure in one line to be ignored */" ,
247253 " \" test.key.ignored \" = \" This is a test key to be ignored #bc-ignore! \" ; " , " " ,
254+ " /* This key should be ignored when ignoreEmptyKeys is set */" ,
255+ " \" test.key.ignoreEmptyStrings \" = \" \" ; " , " " ,
248256 " /* Class = \"UIButton\"; normalTitle = \"😀\"; ObjectID = \"abc-12-345\"; */" ,
249257 " \" abc-12-345.normalTitle \" = \" 😀 \" ; " , " " ,
250258 " /* Class = \"UILabel\"; text = \"Refraktionsentfernung in Meter\"; ObjectID = \"em1-3S-vgp\"; */" ,
@@ -258,7 +266,7 @@ class StringsFileUpdaterTests: XCTestCase {
258266 XCTAssertEqual ( oldLinesInFile [ index] , expectedLine)
259267 }
260268
261- stringsFileUpdater. incrementallyUpdateKeys ( withStringsFileAtPath: newStringsFilePath, addNewValuesAsEmpty: false )
269+ stringsFileUpdater. incrementallyUpdateKeys ( withStringsFileAtPath: newStringsFilePath, addNewValuesAsEmpty: false , ignoreEmptyStrings : true )
262270
263271 let expectedLinesAfterIncrementalUpdate = [
264272 " " , " /* Class = \"UIButton\"; normalTitle = \"New Example Button 1\"; ObjectID = \"35F-cl-mdI\"; */" ,
0 commit comments