Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit f3c5de6

Browse files
committed
clean up single line strings
1 parent 0ae6c40 commit f3c5de6

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

spec/body-parser-spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ the quick brown $1fox \${2:jumped \${3:over}
116116

117117

118118
it("parses a snippet with transformations and mirrors", () => {
119-
const bodyTree = BodyParser.parse("${1:placeholder}\n\${1/(.)/\\u$1/}\n$1");
119+
const bodyTree = BodyParser.parse("${1:placeholder}\n${1/(.)/\\u$1/}\n$1");
120120
expect(bodyTree).toEqual([
121121
{index: 1, content: ['placeholder']},
122122
'\n',
@@ -137,7 +137,7 @@ the quick brown $1fox \${2:jumped \${3:over}
137137
});
138138

139139
it("parses a snippet with a format string and case-control flags", () => {
140-
const bodyTree = BodyParser.parse("<\${1:p}>$0</\${1/(.)(.*)/\\u$1$2/}>");
140+
const bodyTree = BodyParser.parse("<${1:p}>$0</${1/(.)(.*)/\\u$1$2/}>");
141141
expect(bodyTree).toEqual([
142142
'<',
143143
{index: 1, content: ['p']},
@@ -187,7 +187,7 @@ the quick brown $1fox \${2:jumped \${3:over}
187187
});
188188

189189
it("parses a snippet with a placeholder that mirrors another tab stop's content", () => {
190-
const bodyTree = BodyParser.parse("$4console.\${3:log}('\${2:$1}', $1);$0");
190+
const bodyTree = BodyParser.parse("$4console.${3:log}('${2:$1}', $1);$0");
191191
expect(bodyTree).toEqual([
192192
{index: 4, content: []},
193193
'console.',

spec/snippets-spec.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,7 @@ third tabstop $3\
240240

241241
"large indices": {
242242
prefix: "t10",
243-
body: `\
244-
hello\${10} \${11:large} indices\${1}\
245-
`
243+
body: "hello${10} ${11:large} indices${1}"
246244
},
247245

248246
"no body": {
@@ -256,40 +254,28 @@ hello\${10} \${11:large} indices\${1}\
256254

257255
"many tabstops": {
258256
prefix: "t11",
259-
body: `\
260-
$0one\${1} \${2:two} three\${3}\
261-
`
257+
body: "$0one${1} ${2:two} three${3}"
262258
},
263259

264260
"simple transform": {
265261
prefix: "t12",
266-
body: `\
267-
[\${1:b}][/\${1/[ ]+.*$//}]\
268-
`
262+
body: "[${1:b}][/${1/[ ]+.*$//}]"
269263
},
270264
"transform with non-transforming mirrors": {
271265
prefix: "t13",
272-
body: `\
273-
\${1:placeholder}\n\${1/(.)/\\u$1/}\n$1\
274-
`
266+
body: "${1:placeholder}\n${1/(.)/\\u$1/}\n$1"
275267
},
276268
"multiple tab stops, some with transforms and some without": {
277269
prefix: "t14",
278-
body: `\
279-
\${1:placeholder} \${1/(.)/\\u$1/} $1 \${2:ANOTHER} \${2/^(.*)$/\\L$1/} $2\
280-
`
270+
body: "${1:placeholder} ${1/(.)/\\u$1/} $1 ${2:ANOTHER} ${2/^(.*)$/\\L$1/} $2"
281271
},
282272
"has a transformed tab stop without a corresponding ordinary tab stop": {
283273
prefix: 't15',
284-
body: `\
285-
\${1/(.)/\\u$1/} & $2\
286-
`
274+
body: "${1/(.)/\\u$1/} & $2"
287275
},
288276
"has a transformed tab stop that occurs before the corresponding ordinary tab stop": {
289277
prefix: 't16',
290-
body: `\
291-
& \${1/(.)/\\u$1/} & \${1:q}\
292-
`
278+
body: "& ${1/(.)/\\u$1/} & ${1:q}"
293279
},
294280
"has a placeholder that mirrors another tab stop's content": {
295281
prefix: 't17',

0 commit comments

Comments
 (0)