@@ -137,3 +137,35 @@ test "tagged template literal with an interpolated string that itself contains a
137137test " tagged template literal with an interpolated string that contains a tagged template literal" , ->
138138 eq ' text: [inner tagged | literal] expressions: [text: [|] expressions: [template]]' ,
139139 func" inner tagged #{ func" #{ ' template' } " } literal"
140+
141+ test " tagged template literal with backticks" , ->
142+ eq ' text: [ES template literals look like this: `foo bar`] expressions: []' ,
143+ func" ES template literals look like this: `foo bar`"
144+
145+ test " tagged template literal with escaped backticks" , ->
146+ eq ' text: [ES template literals look like this: \\ `foo bar\\ `] expressions: []' ,
147+ func" ES template literals look like this: \\ `foo bar\\ `"
148+
149+ test " tagged template literal with unnecessarily escaped backticks" , ->
150+ eq ' text: [ES template literals look like this: `foo bar`] expressions: []' ,
151+ func" ES template literals look like this: \` foo bar\` "
152+
153+ test " tagged template literal with ES interpolation" , ->
154+ eq ' text: [ES template literals also look like this: `3 + 5 = ${3+5}`] expressions: []' ,
155+ func" ES template literals also look like this: `3 + 5 = ${3+5}`"
156+
157+ test " tagged template literal with both ES and CoffeeScript interpolation" , ->
158+ eq " text: [ES template literals also look like this: `3 + 5 = ${3+5}` which equals |] expressions: [8]" ,
159+ func" ES template literals also look like this: `3 + 5 = ${3+5}` which equals #{ 3 + 5 } "
160+
161+ test " tagged template literal with escaped ES interpolation" , ->
162+ eq ' text: [ES template literals also look like this: `3 + 5 = \\ ${3+5}`] expressions: []' ,
163+ func" ES template literals also look like this: `3 + 5 = \\ ${3+5}`"
164+
165+ test " tagged template literal with unnecessarily escaped ES interpolation" , ->
166+ eq ' text: [ES template literals also look like this: `3 + 5 = ${3+5}`] expressions: []' ,
167+ func" ES template literals also look like this: `3 + 5 = \$ {3+5}`"
168+
169+ test " tagged template literal special escaping" , ->
170+ eq ' text: [` ` \\ ` \\ ` \\\\ ` $ { ${ ${ \\ ${ \\ ${ \\\\ ${ | ` ${] expressions: [1]' ,
171+ func" ` \` \\ ` \\\` \\\\ ` $ { ${ \$ { \\ ${ \\\$ { \\\\ ${ #{ 1 } ` ${"
0 commit comments