test('Embedded Content #6', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<script>a</script><script>b</script>', tokens: [ { startIndex:0, type: DELIM_START, bracket: Modes.Bracket.Open }, { startIndex:1, type: getTag('script') }, { startIndex:7, type: DELIM_START, bracket: Modes.Bracket.Close }, { startIndex:8, type: 'identifier.js' }, { startIndex:9, type: DELIM_END, bracket: Modes.Bracket.Open }, { startIndex:11, type: getTag('script') }, { startIndex:17, type: DELIM_END, bracket: Modes.Bracket.Close }, { startIndex:18, type: DELIM_START, bracket: Modes.Bracket.Open }, { startIndex:19, type: getTag('script') }, { startIndex:25, type: DELIM_START, bracket: Modes.Bracket.Close }, { startIndex:26, type: 'identifier.js' }, { startIndex:27, type: DELIM_END, bracket: Modes.Bracket.Open }, { startIndex:29, type: getTag('script') }, { startIndex:35, type: DELIM_END, bracket: Modes.Bracket.Close } ]} ]); });
test('Tag with Name-Only-Attribute #1', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<abc foo>', tokens: [ { startIndex:0, type: DELIM_START }, { startIndex:1, type: getTag('abc') }, { startIndex:4, type: '' }, { startIndex:5, type: ATTRIB_NAME }, { startIndex:8, type: DELIM_START } ]} ]); });
test('Embedded Content #9', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<script type="text/javascript" src="main.js"></script>', tokens: [ { startIndex:0, type: DELIM_START }, { startIndex:1, type: getTag('script') }, { startIndex:7, type: '' }, { startIndex:8, type: ATTRIB_NAME }, { startIndex:12, type: DELIM_ASSIGN }, { startIndex:13, type: ATTRIB_VALUE }, { startIndex:30, type: '' }, { startIndex:31, type: ATTRIB_NAME }, { startIndex:34, type: DELIM_ASSIGN }, { startIndex:35, type: ATTRIB_VALUE }, { startIndex:44, type: DELIM_START }, { startIndex:45, type: DELIM_END }, { startIndex:47, type: getTag('script') }, { startIndex:53, type: DELIM_END } ]} ]); });
test('Embedded Content #6', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<script>a</script><script>b</script>', tokens: [ { startIndex:0, type: DELIM_START }, { startIndex:1, type: getTag('script') }, { startIndex:7, type: DELIM_START }, { startIndex:8, type: 'mock-js' }, { startIndex:9, type: DELIM_END }, { startIndex:11, type: getTag('script') }, { startIndex:17, type: DELIM_END }, { startIndex:18, type: DELIM_START }, { startIndex:19, type: getTag('script') }, { startIndex:25, type: DELIM_START }, { startIndex:26, type: 'mock-js' }, { startIndex:27, type: DELIM_END }, { startIndex:29, type: getTag('script') }, { startIndex:35, type: DELIM_END } ]} ]); });
test('Embedded Content #4', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<script type="text/javascript">', tokens: [ { startIndex:0, type: DELIM_START }, { startIndex:1, type: getTag('script') }, { startIndex:7, type: '' }, { startIndex:8, type: ATTRIB_NAME }, { startIndex:12, type: DELIM_ASSIGN }, { startIndex:13, type: ATTRIB_VALUE }, { startIndex:30, type: DELIM_START } ]}, { line: 'var i= 10;</script>', tokens: [ { startIndex:0, type: 'mock-js' }, { startIndex:10, type: DELIM_END }, { startIndex:12, type: getTag('script') }, { startIndex:18, type: DELIM_END } ]} ]); });
test('Tag with Invalid Attribute Value', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<abc foo=">', tokens: [ { startIndex:0, type: DELIM_START }, { startIndex:1, type: getTag('abc') }, { startIndex:4, type: '' }, { startIndex:5, type: ATTRIB_NAME }, { startIndex:8, type: DELIM_ASSIGN }, { startIndex:9, type: ATTRIB_VALUE } ]} ]); });
test('Tag with Name-Only-Attribute #2', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<abc foo bar>', tokens: [ { startIndex:0, type: DELIM_START, bracket: Modes.Bracket.Open }, { startIndex:1, type: getTag('abc') }, { startIndex:4, type: '' }, { startIndex:5, type: ATTRIB_NAME }, { startIndex:8, type: '' }, { startIndex:9, type: ATTRIB_NAME }, { startIndex:12, type: DELIM_START, bracket: Modes.Bracket.Close } ]} ]); });
test('Tag with empty atrributes', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<abc foo="">', tokens: [ { startIndex:0, type: DELIM_START, bracket: Modes.Bracket.Open }, { startIndex:1, type: getTag('abc') }, { startIndex:4, type: '' }, { startIndex:5, type: ATTRIB_NAME }, { startIndex:8, type: DELIM_ASSIGN }, { startIndex:9, type: ATTRIB_VALUE }, { startIndex:11, type: DELIM_START, bracket: Modes.Bracket.Close } ]} ]); });
test('Tag with Interesting Attribute Name', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<abc foo!@#="bar">', tokens: [ { startIndex:0, type: DELIM_START }, { startIndex:1, type: getTag('abc') }, { startIndex:4, type: '' }, { startIndex:5, type: ATTRIB_NAME }, { startIndex:11, type: DELIM_ASSIGN }, { startIndex:12, type: ATTRIB_VALUE }, { startIndex:17, type: DELIM_START } ]} ]); });
test('Embedded Content #1', () => { modesUtil.assertTokenization(tokenizationSupport, [{ line: '<script type="text/javascript">var i= 10;</script>', tokens: [ { startIndex:0, type: DELIM_START }, { startIndex:1, type: getTag('script') }, { startIndex:7, type: '' }, { startIndex:8, type: ATTRIB_NAME }, { startIndex:12, type: DELIM_ASSIGN }, { startIndex:13, type: ATTRIB_VALUE }, { startIndex:30, type: DELIM_START }, { startIndex:31, type: 'keyword.js' }, { startIndex:34, type: '' }, { startIndex:35, type: 'identifier.js' }, { startIndex:36, type: 'delimiter.js' }, { startIndex:37, type: '' }, { startIndex:38, type: 'number.js' }, { startIndex:40, type: 'delimiter.js' }, { startIndex:41, type: DELIM_END }, { startIndex:43, type: getTag('script') }, { startIndex:49, type: DELIM_END } ]} ]); });