Initial commit

This commit is contained in:
Developer
2025-04-21 16:03:20 +02:00
commit 2832896157
22874 changed files with 3092801 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
var s = `a
b
c`;
assert.equal(s, 'a\n b\n c');

View File

@@ -0,0 +1,6 @@
/* jshint esnext:true */
assert.strictEqual(
`a${1}b${`${1+1}c`}3`,
'a1b2c3'
);

View File

@@ -0,0 +1,2 @@
var s = `str`;
assert.equal(s, 'str');

View File

@@ -0,0 +1,6 @@
function r(strings) {
assert.equal(strings.raw[0], '\\n');
return strings.raw.join('');
}
assert.equal(r `\n`, '\\n');

View File

@@ -0,0 +1,2 @@
var s = `1 + 1 = ${1 + 1}`;
assert.equal(s, '1 + 1 = 2');

View File

@@ -0,0 +1,26 @@
function tag(strings) {
var values = [].slice.call(arguments, 1);
assert.equal(strings[0], 'a');
assert.equal(strings[1], 'b');
assert.equal(values[0], 42);
return 'whatever';
}
assert.equal(tag `a${ 42 }b`, 'whatever');
function tagInterpolateFirst(strings) {
var values = [].slice.call(arguments, 1);
assert.equal(strings[0], '');
assert.equal(strings[1], 'b');
assert.equal(values[0], 42);
return 'whatever';
}
assert.equal(tagInterpolateFirst `${ 42 }b`, 'whatever');
function tagInterpolateLast(strings) {
var values = [].slice.call(arguments, 1);
assert.equal(strings[0], 'a');
assert.equal(strings[1], '');
assert.equal(values[0], 42);
return 'whatever';
}
assert.equal(tagInterpolateLast `a${ 42 }`, 'whatever');