summary refs log tree commit diff stats
path: root/tests/js/tmangle.nim
diff options
context:
space:
mode:
authorMichael Jendrusch <Jendrusch@stud.uni-heidelberg.de>2017-01-20 05:16:42 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-01-20 05:16:42 +0100
commit953b8cbcc2764f62d462ea7f7be404d4fe3dac3a (patch)
treee2fea93ffc25e507455ddc496543ed433d072df0 /tests/js/tmangle.nim
parente8a00b805f841a68911026f4461c1cb5c936711b (diff)
downloadNim-953b8cbcc2764f62d462ea7f7be404d4fe3dac3a.tar.gz
fixes #5234 (#5240)
Diffstat (limited to 'tests/js/tmangle.nim')
-rw-r--r--tests/js/tmangle.nim23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/js/tmangle.nim b/tests/js/tmangle.nim
index 91193d5a7..c4167ba39 100644
--- a/tests/js/tmangle.nim
+++ b/tests/js/tmangle.nim
@@ -3,6 +3,8 @@ discard """
 true
 true
 true
+true
+true
 true'''
 """
 
@@ -64,6 +66,27 @@ block:
     result = result and obj2.`&&`.isNil()
   echo test()
 
+# Test codegen for fields with uppercase letters:
+block:
+  type MyObj = object
+    mField: int
+  proc test(): bool =
+    var a: MyObj
+    var b = a
+    result = b.mField == 0
+  echo test()
+
+# Test tuples
+block:
+  type T = tuple
+    a: int
+    b: int
+  proc test(): bool =
+    var a: T = (a: 1, b: 1)
+    result = a.a == 1
+    result = result and a.b == 1
+  echo test()
+
 # Test importc / exportc fields:
 block:
   type T = object