diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-05-01 14:53:48 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-05-01 14:53:48 -0700 |
| commit | 9ccd0ba9611d7828f42bffca919c7ad3177cbbe1 (patch) | |
| tree | 4600e2c82685c1c1fb674d1f200a154c5cf4b1ab /test | |
| parent | 037283c3b3e425193eebb766c17336ee55aa0384 (diff) | |
| download | zig-9ccd0ba9611d7828f42bffca919c7ad3177cbbe1.tar.gz zig-9ccd0ba9611d7828f42bffca919c7ad3177cbbe1.zip | |
implement string escapes
Diffstat (limited to 'test')
| -rw-r--r-- | test/self_hosted.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/self_hosted.zig b/test/self_hosted.zig index 4a787ac665..e33f726590 100644 --- a/test/self_hosted.zig +++ b/test/self_hosted.zig @@ -1398,3 +1398,14 @@ fn test_take_address_of_parameter_noeval(f: f32) { fn array_mult_operator() { assert(str.eql("ab" ** 5, "ababababab")); } + +#attribute("test") +fn string_escapes() { + assert(str.eql("\"", "\x22")); + assert(str.eql("\'", "\x27")); + assert(str.eql("\n", "\x0a")); + assert(str.eql("\r", "\x0d")); + assert(str.eql("\t", "\x09")); + assert(str.eql("\\", "\x5c")); + assert(str.eql("\u1234\u0069", "\xe1\x88\xb4\x69")); +} |
