diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-06-06 22:33:30 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-06-06 22:35:15 +0200 |
| commit | f25b8789962157f7fa2af55b139a75e2ee1a09af (patch) | |
| tree | 3cac053fa23bec31045eabd3f0e9147a8faf6b0a /server/common/src/tests.rs | |
| parent | b0942ad84aaa25443b57812bcea50c2bde03e03b (diff) | |
grit: Allow if's to be recursive
Not often used in grit files, if at all, but needed when we want
to add support for expanding grit-part in grit structure.
Diffstat (limited to 'server/common/src/tests.rs')
| -rw-r--r-- | server/common/src/tests.rs | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/server/common/src/tests.rs b/server/common/src/tests.rs index fc4d7aa..f336f67 100644 --- a/server/common/src/tests.rs +++ b/server/common/src/tests.rs @@ -322,11 +322,13 @@ async fn test_grit_parse_base() { grit::IfOutput::If { expr: "not pp_if('zawgyi_encoding')".to_string(), output: vec![ - grit::Output { - filename: "values-my-rZG/strings.xml".to_string(), - output_type: "android".to_string(), - lang: "my-ZG".to_string(), - }, + grit::IfOutput::Output( + grit::Output { + filename: "values-my-rZG/strings.xml".to_string(), + output_type: "android".to_string(), + lang: "my-ZG".to_string(), + }, + ), ], }, grit::IfOutput::Output( @@ -349,23 +351,29 @@ async fn test_grit_parse_base() { grit::IfFile::If { expr: "pp_if('zawgyi_encoding')".to_string(), file: vec![ - grit::File { - path: "translations/base_my-Zawgyi.xlf".to_string(), - lang: "my".to_string(), - }, + grit::IfFile::File( + grit::File { + path: "translations/base_my-Zawgyi.xlf".to_string(), + lang: "my".to_string(), + }, + ), ], }, grit::IfFile::If { expr: "not pp_if('zawgyi_encoding')".to_string(), file: vec![ - grit::File { - path: "translations/base_my.xlf".to_string(), - lang: "my".to_string(), - }, - grit::File { - path: "translations/base_my-Zawgyi.xlf".to_string(), - lang: "my-ZG".to_string(), - }, + grit::IfFile::File( + grit::File { + path: "translations/base_my.xlf".to_string(), + lang: "my".to_string(), + }, + ), + grit::IfFile::File( + grit::File { + path: "translations/base_my-Zawgyi.xlf".to_string(), + lang: "my-ZG".to_string(), + }, + ), ], }, grit::IfFile::File( @@ -385,7 +393,7 @@ async fn test_grit_parse_base() { grit::IfMessagePart::If { expr: "pp_ifdef('include_extra')".to_string(), message: vec