Skip to content

Commit

Permalink
Properly translate number sets (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Helwer <2n8rn1w1f@mozmail.com>
  • Loading branch information
ahelwer authored Apr 23, 2024
1 parent 95b3570 commit 36cb75b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tlauc"
description = "Rewrites TLA⁺ specs to use Unicode symbols instead of ASCII, and vice-versa"
version = "1.0.0"
version = "1.0.1"
authors = ["Andrew Helwer <2n8rn1w1f@mozmail.com>"]
repository = "https://github.com/tlaplus-community/tlauc"
license = "MIT"
Expand All @@ -17,7 +17,7 @@ clap = { version = "4.5.4", features = ["derive"] }
csv = "1.3.0"
serde = { version = "1.0.197", features = ["derive"] }
tree-sitter = "0.22.5"
tree-sitter-tlaplus = "1.2.8"
tree-sitter-tlaplus = "1.3.3"

[dev-dependencies]
glob = "0.3.1"
Expand Down
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,23 @@ op == /\ A
);
}

// See https://github.com/tlaplus-community/tlauc/issues/11
// Test translation of number sets in their three forms:
// 1. As an expression
// 2. As the left-hand-side of an operator definition
// 3. As a reference to an imported module
#[test]
fn test_translate_number_set() {
run_roundtrip_test(
r#"
---- MODULE Test ----
Nat == Nat \union A!B!Nat
Int == Int \union A!B!Int
Real == Real \union A!B!Real
===="#,
);
}

// https://github.com/tlaplus-community/tlauc/issues/1
#[ignore]
#[test]
Expand Down

0 comments on commit 36cb75b

Please sign in to comment.