Skip to content

Commit 3bd7fce

Browse files
committed
test(gencat): add tests for gencat sets and messages with quotes being unset
1 parent 1e951e8 commit 3bd7fce

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

i18n/tests/gencat/mod.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,29 @@ fn gencat_sets_and_messagess_with_quote() {
102102
Vec::new(),
103103
);
104104
}
105+
106+
#[test]
107+
fn gencat_sets_and_messagess_with_quote_unset() {
108+
let cargo_manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
109+
let msg_file = cargo_manifest_dir.join("tests/gencat/sets_and_messages_with_quote_unset.msg");
110+
111+
#[cfg(not(target_os = "macos"))]
112+
let expected_cat_file =
113+
cargo_manifest_dir.join("tests/gencat/sets_and_messages_with_quote_unset_gnu_catfile.cat");
114+
115+
#[cfg(target_os = "macos")]
116+
let expected_cat_file =
117+
cargo_manifest_dir.join("tests/gencat/sets_and_messages_with_quote_unset_osx_catfile.cat");
118+
119+
let mut expected_output: Vec<u8> = Vec::new();
120+
File::open(&expected_cat_file)
121+
.unwrap()
122+
.read_to_end(&mut expected_output)
123+
.unwrap();
124+
125+
gencat_test(
126+
&["-", msg_file.to_str().unwrap()],
127+
expected_output,
128+
Vec::new(),
129+
);
130+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$quote -
2+
3+
$quote
4+
5+
$ the first quote should be unset(as we have $quote <BLANK>)(i.e it should not be considered as a encapsulating boundary for message)
6+
7+
$set 1
8+
1 - This is first message-
9+
2 -This is second message-
10+
11+
$set 2
12+
1 -This is third message-
13+
2 This is fourth message
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)