mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
add tests
This commit is contained in:
parent
b995fa2c05
commit
5bdff0c4a7
2 changed files with 116 additions and 42 deletions
|
|
@ -7,12 +7,77 @@
|
|||
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('apex', [
|
||||
// Comments - single line
|
||||
testTokenization('abap', [
|
||||
[{
|
||||
line: '* comment',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'comment.abap' }
|
||||
]
|
||||
}]
|
||||
}],
|
||||
[{
|
||||
line: ' " comment',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 1, type: 'comment.abap' }
|
||||
]
|
||||
}],
|
||||
[{
|
||||
line: 'write hello.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.abap' },
|
||||
{ startIndex: 5, type: '' },
|
||||
{ startIndex: 6, type: 'identifier.abap' },
|
||||
{ startIndex: 11, type: 'delimiter.abap' }
|
||||
]
|
||||
}],
|
||||
[{
|
||||
line: 'IF 2 = 3.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.abap' },
|
||||
{ startIndex: 2, type: '' },
|
||||
{ startIndex: 3, type: 'number.abap' },
|
||||
{ startIndex: 4, type: '' },
|
||||
{ startIndex: 5, type: 'operator.abap' },
|
||||
{ startIndex: 6, type: '' },
|
||||
{ startIndex: 7, type: 'number.abap' },
|
||||
{ startIndex: 8, type: 'delimiter.abap' }
|
||||
]
|
||||
}],
|
||||
[{
|
||||
line: '\'hello\'',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.abap' },
|
||||
]
|
||||
}],
|
||||
[{
|
||||
line: '|hello|',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.abap' },
|
||||
]
|
||||
}],
|
||||
[{
|
||||
line: 'write: hello, world.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.abap' },
|
||||
{ startIndex: 5, type: 'delimiter.abap' },
|
||||
{ startIndex: 6, type: '' },
|
||||
{ startIndex: 7, type: 'identifier.abap' },
|
||||
{ startIndex: 12, type: 'delimiter.abap' },
|
||||
{ startIndex: 13, type: '' },
|
||||
{ startIndex: 14, type: 'identifier.abap' },
|
||||
{ startIndex: 19, type: 'delimiter.abap' },
|
||||
]
|
||||
}],
|
||||
[{
|
||||
line: 'method_call( param ).',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.abap' },
|
||||
{ startIndex: 11, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 12, type: '' },
|
||||
{ startIndex: 13, type: 'identifier.abap' },
|
||||
{ startIndex: 18, type: '' },
|
||||
{ startIndex: 19, type: 'delimiter.parenthesis.abap' },
|
||||
{ startIndex: 20, type: 'delimiter.abap' },
|
||||
]
|
||||
}],
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue