mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-27 22:45:25 +00:00
larry babby and threejs for glsl
This commit is contained in:
36
webGl/my-threejs-test/node_modules/@parcel/diagnostic/test/JSONCodeHighlights.test.js
generated
vendored
Normal file
36
webGl/my-threejs-test/node_modules/@parcel/diagnostic/test/JSONCodeHighlights.test.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
// @flow strict-local
|
||||
import assert from 'assert';
|
||||
|
||||
import {generateJSONCodeHighlights} from '../src/diagnostic';
|
||||
|
||||
describe('generateJSONCodeHighlights', () => {
|
||||
it('returns an escaped string 01', () => {
|
||||
let result = generateJSONCodeHighlights(
|
||||
`{
|
||||
"a": 1
|
||||
}`,
|
||||
[
|
||||
{key: '/a', type: 'key', message: 'foo1'},
|
||||
{key: '/a', type: 'value', message: 'foo2'},
|
||||
{key: '/a', message: 'foo3'},
|
||||
],
|
||||
);
|
||||
assert.deepEqual(result, [
|
||||
{
|
||||
start: {line: 2, column: 3},
|
||||
end: {line: 2, column: 5},
|
||||
message: 'foo1',
|
||||
},
|
||||
{
|
||||
start: {line: 2, column: 8},
|
||||
end: {line: 2, column: 8},
|
||||
message: 'foo2',
|
||||
},
|
||||
{
|
||||
start: {line: 2, column: 3},
|
||||
end: {line: 2, column: 8},
|
||||
message: 'foo3',
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
81
webGl/my-threejs-test/node_modules/@parcel/diagnostic/test/markdown.test.js
generated
vendored
Normal file
81
webGl/my-threejs-test/node_modules/@parcel/diagnostic/test/markdown.test.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
// @flow
|
||||
import assert from 'assert';
|
||||
|
||||
import {escapeMarkdown, md} from '../src/diagnostic';
|
||||
|
||||
describe('escapeMarkdown', () => {
|
||||
it('returns an escaped string 01', () => {
|
||||
assert.strictEqual('\\*test\\*', escapeMarkdown('*test*'));
|
||||
});
|
||||
|
||||
it('returns an escaped string 02', () => {
|
||||
assert.strictEqual('\\_test\\_', escapeMarkdown('_test_'));
|
||||
});
|
||||
|
||||
it('returns an escaped string 03', () => {
|
||||
assert.strictEqual('\\~test\\~', escapeMarkdown('~test~'));
|
||||
});
|
||||
|
||||
it('returns an escaped string 04', () => {
|
||||
assert.strictEqual('\\*\\_\\~test\\~\\_\\*', escapeMarkdown('*_~test~_*'));
|
||||
});
|
||||
|
||||
it('returns an escaped string with backslash 01', () => {
|
||||
assert.strictEqual('\\\\test\\\\', escapeMarkdown('\\test\\'));
|
||||
});
|
||||
|
||||
it('returns an escaped string with backslash 02', () => {
|
||||
assert.strictEqual('\\\\\\*test\\*\\\\', escapeMarkdown('\\*test*\\'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('md tagged template literal', () => {
|
||||
it('bold placeholder', () => {
|
||||
assert.strictEqual(
|
||||
'*Test*: **\\_abc\\_**',
|
||||
md`*Test*: ${md.bold('_abc_')}`,
|
||||
);
|
||||
});
|
||||
|
||||
it('italic placeholder', () => {
|
||||
assert.strictEqual(
|
||||
'*Test*: _\\_abc\\__',
|
||||
md`*Test*: ${md.italic('_abc_')}`,
|
||||
);
|
||||
});
|
||||
|
||||
it('underline placeholder', () => {
|
||||
assert.strictEqual(
|
||||
'*Test*: __\\_abc\\___',
|
||||
md`*Test*: ${md.underline('_abc_')}`,
|
||||
);
|
||||
});
|
||||
|
||||
it('strikethrough placeholder', () => {
|
||||
assert.strictEqual(
|
||||
'*Test*: ~~\\_abc\\_~~',
|
||||
md`*Test*: ${md.strikethrough('_abc_')}`,
|
||||
);
|
||||
});
|
||||
|
||||
it('escapes only placeholders', () => {
|
||||
assert.strictEqual('*Test*: \\_abc\\_', md`*Test*: ${'_abc_'}`);
|
||||
});
|
||||
|
||||
it('behaves like native template literal', () => {
|
||||
let v = {
|
||||
toString() {
|
||||
return 'a';
|
||||
},
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
[Symbol.toPrimitive]() {
|
||||
return 'b';
|
||||
},
|
||||
};
|
||||
assert.strictEqual('Test: b', md`Test: ${v}`);
|
||||
});
|
||||
|
||||
it('supports null and undefined', () => {
|
||||
assert.strictEqual('Test: undefined null', md`Test: ${undefined} ${null}`);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user