Skip to content

Commit

Permalink
failing test: for endIndex 0 in rangeBy
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Mar 20, 2024
1 parent 0fd1d86 commit 1bea246
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/warning.test.ts
Expand Up @@ -85,6 +85,24 @@ test('gets range from node without end', () => {
is(warning.endColumn, 2)
})

test('gets range from node with endIndex 3', () => {
let root = parse('a{}')
let warning = new Warning('text', { node: root.first, index: 0, endIndex: 3 })
is(warning.line, 1)
is(warning.column, 1)
is(warning.endLine, 1)
is(warning.endColumn, 4)
})

test('gets range from node with endIndex 0', () => {
let root = parse('a{}')
let warning = new Warning('text', { node: root.first, index: 0, endIndex: 0 })
is(warning.line, 1)
is(warning.column, 1)
is(warning.endLine, 1)
is(warning.endColumn, 2)
})

test('gets range from word', () => {
let root = parse('a b{}')
let warning = new Warning('text', { node: root.first, word: 'b' })
Expand Down

0 comments on commit 1bea246

Please sign in to comment.