From 8150803e77fb749bb331cf4072ebc9e87d3d0e96 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Aug 2022 20:02:05 +0300 Subject: test(tvix/eval): add some eval-okay-* tests for trivial types Change-Id: I85ccc07e08c67abf4fcd3752c58e1702943239ac Reviewed-on: https://cl.tvl.fyi/c/depot/+/6135 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.nix | 6 ++++++ tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.nix | 6 ++++++ tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.nix | 2 ++ tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix | 1 + .../src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.exp | 1 + .../src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix | 4 ++++ tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix | 1 + 12 files changed, 26 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.exp new file mode 100644 index 000000000000..08ef6079f899 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.exp @@ -0,0 +1 @@ +{ add = 37.34; div = 1.05714; mul = 105.154; sub = 14.35; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.nix new file mode 100644 index 000000000000..9d12aee061b2 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-float.nix @@ -0,0 +1,6 @@ +{ + add = 12.34 + 25.0; + sub = 20.05 - 5.7; + mul = 28.42 * 3.70; + div = 18.5 / 17.5; +} diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.exp new file mode 100644 index 000000000000..a5711e8bfe9b --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.exp @@ -0,0 +1 @@ +{ add = 20; div = 3; mul = 8; sub = 15; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.nix new file mode 100644 index 000000000000..c53790db099b --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-arithmetic-int.nix @@ -0,0 +1,6 @@ +{ + add = 15 + 5; + sub = 20 - 5; + mul = 4 * 2; + div = 9 / 3; +} diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.exp new file mode 100644 index 000000000000..9839e480b781 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.exp @@ -0,0 +1 @@ +"hello\nworld" diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.nix new file mode 100644 index 000000000000..84beb22ed5c3 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-multiline-string.nix @@ -0,0 +1,2 @@ +''hello +world'' diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.exp new file mode 100644 index 000000000000..b5c707cf462e --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.exp @@ -0,0 +1 @@ +{ a = { b = 15; }; b = { c = "test"; }; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix new file mode 100644 index 000000000000..5d611930ca7a --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix @@ -0,0 +1 @@ +{ a.b = 15; b.c = "test"; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.exp new file mode 100644 index 000000000000..2483a2718301 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.exp @@ -0,0 +1 @@ +{ a = { b = 15; c = "test"; }; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix new file mode 100644 index 000000000000..4154ff9da29f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix @@ -0,0 +1,4 @@ +{ + a.b = 15; + a.c = "test"; +} diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.exp new file mode 100644 index 000000000000..6db47b033efb --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.exp @@ -0,0 +1 @@ +{ a = { b = 42; }; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix new file mode 100644 index 000000000000..a97394d16523 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix @@ -0,0 +1 @@ +{ a.b = 42; } -- cgit 1.4.1