Skip to content

Commit

Permalink
fix ptk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scopatz committed Oct 23, 2019
1 parent bf0329b commit ca7acec
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions tests/test_ptk_highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Operator,
Punctuation,
Text,
Literal,
)
from tools import skip_if_on_windows

Expand Down Expand Up @@ -62,7 +63,18 @@ def test_bin_ls():

@skip_if_on_windows
def test_py_print():
check_token('print("hello")', [(Keyword, "print"), (String.Double, "hello")])
check_token(
'print("hello")',
[
(Name.Builtin, "print"),
(Punctuation, "("),
(Literal.String.Double, '"'),
(Literal.String.Double, "hello"),
(Literal.String.Double, '"'),
(Punctuation, ")"),
(Text, "\n"),
],
)


@skip_if_on_windows
Expand Down Expand Up @@ -101,24 +113,29 @@ def test_nested():
check_token(
"print($(cd))",
[
(Keyword, "print"),
(Name.Builtin, "print"),
(Punctuation, "("),
(Keyword, "$"),
(Punctuation, "("),
(Name.Builtin, "cd"),
(Punctuation, ")"),
(Punctuation, ")"),
(Text, "\n"),
],
)
check_token(
r'print(![echo "])\""])',
[
(Keyword, "print"),
(Name.Builtin, "print"),
(Punctuation, "("),
(Keyword, "!"),
(Punctuation, "["),
(Name.Builtin, "echo"),
(String.Double, r'"])\""'),
(Text, " "),
(Literal.String.Double, '"])\\""'),
(Punctuation, "]"),
(Punctuation, ")"),
(Text, "\n"),
],
)

Expand Down

0 comments on commit ca7acec

Please sign in to comment.