summaryrefslogtreecommitdiff
path: root/test/encodechar.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-09-27 21:21:17 -0400
committerOri Bernstein <ori@eigenstate.org>2012-09-27 21:21:17 -0400
commitb6c2434f14ea813add4b925e0c5a14044d73b593 (patch)
tree4b3c0435e7d8ed125309da75e17814c5e0a3a116 /test/encodechar.myr
parent02922f0289a990a65ad7ede45f2a2e54df7c7162 (diff)
downloadmc-b6c2434f14ea813add4b925e0c5a14044d73b593.tar.gz
Add more tests.
Diffstat (limited to 'test/encodechar.myr')
-rw-r--r--test/encodechar.myr22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/encodechar.myr b/test/encodechar.myr
new file mode 100644
index 0000000..411b99d
--- /dev/null
+++ b/test/encodechar.myr
@@ -0,0 +1,22 @@
+use std
+
+const main = {args : byte[:][:]
+ chartypes()
+}
+
+const chartypes = {
+ var s
+ var c
+ var foo
+ var buf : byte[32]
+
+ s = "1世界äa\n"
+ while s.len != 0
+ (c, s) = std.striter(s)
+ foo = c
+ if !std.encode(buf[:std.charlen(c)], c)
+ std.write(1, "couldn't encode\n")
+ ;;
+ std.write(1, buf[:std.charlen(c)])
+ ;;
+}