Skip to content

Commit fe2b9d1

Browse files
committed
Add tests for custom prompts
1 parent 8b28db7 commit fe2b9d1

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3729,4 +3729,36 @@ julia> begin
37293729
},
37303730
])
37313731
})
3732+
3733+
it("should highlight help prompts", function () {
3734+
const src = "help?> begin"
3735+
const tokens = tokenize(grammar, src)
3736+
compareTokens(tokens, [
3737+
{
3738+
scopes: [
3739+
'source.julia.console',
3740+
'punctuation.separator.prompt.help.julia.console'
3741+
],
3742+
value: 'help?>'
3743+
},
3744+
{ scopes: [ 'source.julia.console' ], value: ' ' },
3745+
{ scopes: [ 'source.julia.console', 'keyword.control.julia' ], value: 'begin' }
3746+
])
3747+
})
3748+
3749+
it("should highlight shell prompts", function () {
3750+
const src = "shell> echo \"hello\""
3751+
const tokens = tokenize(grammar, src)
3752+
compareTokens(tokens, [
3753+
{
3754+
scopes: [
3755+
'source.julia.console',
3756+
'punctuation.separator.prompt.shell.julia.console'
3757+
],
3758+
value: 'shell>'
3759+
},
3760+
{ scopes: [ 'source.julia.console' ], value: ' ' },
3761+
{ scopes: [ 'source.julia.console' ], value: 'echo "hello"' }
3762+
])
3763+
})
37323764
})

0 commit comments

Comments
 (0)