summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorBrandon Pickering <brandonpickering95@gmail.com>2017-01-10 20:54:04 -0800
committerAndreas Rumpf <rumpf_a@web.de>2017-01-11 05:54:04 +0100
commitc98a8f3701c4410b6596cee7809f5e18ec6cf6b7 (patch)
tree8684c0c35bc80a8cea2e807fe4f294fe47201639 /tests
parent88f95a2f7e6a3bf1db7d2cd73606e395ae818d0e (diff)
downloadNim-c98a8f3701c4410b6596cee7809f5e18ec6cf6b7.tar.gz
Handle different enum sizes in reprAux (#5207)
Diffstat (limited to 'tests')
-rw-r--r--tests/system/tenum_array_repr.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/system/tenum_array_repr.nim b/tests/system/tenum_array_repr.nim
new file mode 100644
index 000000000..3634692e3
--- /dev/null
+++ b/tests/system/tenum_array_repr.nim
@@ -0,0 +1,25 @@
+discard """
+  output: '''
+1
+[a, b]
+
+2
+[c, d]
+
+4
+[e, f]'''
+"""
+
+# issue 5045
+
+type size1 = enum a, b
+echo sizeof(size1)
+echo repr([a, b])
+
+type size2 = enum c=0, d=20000
+echo sizeof(size2)
+echo repr([c, d])
+
+type size4 = enum e=0, f=2000000000
+echo sizeof(size4)
+echo repr([e, f])