Skip to content

Commit dca9d29

Browse files
committed
Add (failing) test inline comments with escaped characters being allowed
1 parent 1bc533f commit dca9d29

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

spec/strings_file_validation_helper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
it 'raises' do
88
input = File.join(test_data_dir, 'strings-with-escape-character-in-root-context.strings')
99
expect { described_class.find_duplicated_keys(file: input) }
10-
.to raise_error(RuntimeError, 'Found escaped character outside of allowed contexts on line 4 (current context: root)')
10+
.to raise_error(RuntimeError, 'Found escaped character outside of allowed contexts on line 8 (current context: root)')
1111
end
1212
end
1313

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/* This file has characters root context (not in a comment, or key, or value), which is not a valid `.strings` syntax */
22
"key" = "value";
33
"other key" = "other value";
4+
5+
/* Escaped characters should be allowed in block comments \\ */
6+
"yet another key" = "yet another value"; // Escapes should be allowed in inline comments, too \\
7+
48
\\
59
/* The parsing shouldn't reach this, line. It should tell us the escape up there is not valid. */
610
"final key" = "final value";

0 commit comments

Comments
 (0)