summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-07-04 10:58:14 +0800
committerGitHub <noreply@github.com>2023-07-04 10:58:14 +0800
commit31ba1046fc91f110117b9e1cbd28d1afb4432060 (patch)
treec2232420e79aaaecb99ba05e595ff56165d610df
parentc513e37a7052d44b789b6ec8ccfc94885193a7b5 (diff)
downloadNim-31ba1046fc91f110117b9e1cbd28d1afb4432060.tar.gz
add a test case for #22190 in case of regression (#22217)
-rw-r--r--tests/vm/tvmmisc.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/vm/tvmmisc.nim b/tests/vm/tvmmisc.nim
index 5ddb54411..1a8f68ee8 100644
--- a/tests/vm/tvmmisc.nim
+++ b/tests/vm/tvmmisc.nim
@@ -712,3 +712,24 @@ block:
     var y = "356"
     merge(x, y)
     doAssert x == "3bc"
+
+block: # bug #22190
+  type
+    EVMFork = enum
+      Berlin
+      Istanbul
+      Shanghai
+
+  const
+    Vm2OpAllForks =
+      {EVMFork.low .. EVMFork.high}
+
+    vm2OpExecBlockData = [(forks: Vm2OpAllForks)]
+
+  proc mkOpTable(selected: EVMFork): bool =
+    selected notin vm2OpExecBlockData[0].forks
+
+  const
+    tab = mkOpTable(Berlin)
+
+  doAssert not tab