mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-16 10:34:55 -05:00
Added string interpolation for identifiers
This commit is contained in:
committed by
Jeremy Ashkenas
parent
965034e16e
commit
fe7d5dfd19
18
test/test_string_interpolation.coffee
Normal file
18
test/test_string_interpolation.coffee
Normal file
@@ -0,0 +1,18 @@
|
||||
hello: 'Hello'
|
||||
world: 'World'
|
||||
ok '$hello $world!' is '$hello $world!'
|
||||
ok "$hello $world!" is 'Hello World!'
|
||||
ok "[$hello$world]" is '[HelloWorld]'
|
||||
ok "$hello$$world" is 'Hello$World'
|
||||
|
||||
[s, t, r, i, n, g]: ['s', 't', 'r', 'i', 'n', 'g']
|
||||
ok "$s$t$r$i$n$g" is 'string'
|
||||
ok "\\$s\\$t\\$r\\$i\\$n\\$g" is '$s$t$r$i$n$g'
|
||||
ok "\\$string" is '$string'
|
||||
|
||||
ok "\\$Escaping first" is '$Escaping first'
|
||||
ok "Escaping \\$in middle" is 'Escaping $in middle'
|
||||
ok "Escaping \\$last" is 'Escaping $last'
|
||||
|
||||
ok "$$" is '$$'
|
||||
ok "\\\\$$" is '\\\\$$'
|
||||
Reference in New Issue
Block a user