Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ description = "The canonical multi-locale Overwatch Workshop semantic core."
serde = "1"
serde_json = "1"
sha2 = "0.10"
unicode-ident = "1"

[workspace.lints.rust]
# Unsafe operations inside an unsafe function still need an explicit block so
Expand Down
14 changes: 10 additions & 4 deletions crates/workshop-rs-cli/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn convert_to_zh_cn_with_fallback_reports_the_choice() {
let file = dir.join("unmapped.ws");
std::fs::write(
&file,
"rule (\"setup\") { event { Ongoing - Global; } actions { Disable Inspector Recording; } }",
"variables { global: 0: probe } rule (\"setup\") { event { Ongoing - Global; } actions { Disable Inspector Recording; Set Global Variable(probe, Is Firing Secondary Fire(Event Player)); } }",
)
.unwrap();
let output = run(&[
Expand All @@ -226,11 +226,17 @@ fn convert_to_zh_cn_with_fallback_reports_the_choice() {
String::from_utf8_lossy(&output.stderr)
);
let stdout = String::from_utf8(output.stdout).unwrap();
assert!(stdout.contains("Ongoing - Global"), "{stdout}");
assert!(stdout.contains("Disable Inspector Recording"), "{stdout}");
assert!(
stdout.contains("Toute la partie - Tout le monde"),
"{stdout}"
);
assert!(
stdout.contains("Is Firing Secondary Fire(Joueur exécutant)"),
"{stdout}"
);
let stderr = String::from_utf8_lossy(&output.stderr);
assert!(
stderr.contains("fallback-locale spelling") && stderr.contains("disableInspector"),
stderr.contains("fallback-locale spelling") && stderr.contains("isFiringSecondaryFire"),
"the fallback choice is visible in tooling output: {stderr}"
);
let _ = std::fs::remove_dir_all(&dir);
Expand Down
1 change: 1 addition & 0 deletions crates/workshop-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
sha2.workspace = true
unicode-ident.workspace = true

[build-dependencies]
serde_json.workspace = true
Expand Down
Loading
Loading