nixir/tests/precedence.nix
NotAShelf 49f64c9c98
tests: initial test suite for IR compiler
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I70cd1dfa45add9df58a44add69fbd30a6a6a6964
2026-02-22 00:07:44 +03:00

8 lines
308 B
Nix

# Test operator precedence
let
a = 1 + 2 * 3; # Should be 1 + (2 * 3) = 7
b = 10 - 5 - 2; # Should be (10 - 5) - 2 = 3
c = true && false || true; # Should be (true && false) || true = true
d = 1 < 2 && 3 > 2; # Should be (1 < 2) && (3 > 2) = true
in
{ a = a; b = b; c = c; d = d; }