summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-09-03 22:35:04 +0800
committerGitHub <noreply@github.com>2024-09-03 16:35:04 +0200
commitc948ab9b8511ef2db31bf7b7a366f1e5eff3b0a2 (patch)
tree2e39c039fd75e90a0f2f7527bf173342865629d9 /tests/stdlib
parent4bf323d6c44b329fe1955f210580a73952c081d0 (diff)
downloadNim-c948ab9b8511ef2db31bf7b7a366f1e5eff3b0a2.tar.gz
fixes symbolName for range enums (#24052)
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/tenumutils.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/stdlib/tenumutils.nim b/tests/stdlib/tenumutils.nim
index 67b98efe1..2662a660d 100644
--- a/tests/stdlib/tenumutils.nim
+++ b/tests/stdlib/tenumutils.nim
@@ -35,5 +35,15 @@ template main =
     doAssert $b == "kb0"
     static: doAssert B.high.symbolName == "b2"
 
+  block:
+    type
+      Color = enum
+        Red = "red", Yellow = "yellow", Blue = "blue"
+
+    var s = Red
+    doAssert symbolName(s) == "Red"
+    var x: range[Red..Blue] = Yellow
+    doAssert symbolName(x) == "Yellow"
+
 static: main()
 main()