Skip to content

Commit

Permalink
mix format
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 5, 2023
1 parent 3e930e2 commit 973ff38
Showing 1 changed file with 35 additions and 20 deletions.
55 changes: 35 additions & 20 deletions test/makeup/erlang_lexer/erlang_lexer_tokenizer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -389,32 +389,47 @@ defmodule ErlangLexerTokenizer do

describe "prompt" do
test "without number" do
assert lex("> a.") == [{:generic_prompt, %{selectable: false}, "> "},
{:string_symbol, %{}, "a"},
{:punctuation, %{}, "."}]
assert lex("(a@b)> a.") == [{:generic_prompt, %{selectable: false}, "(a@b)> "},
{:string_symbol, %{}, "a"},
{:punctuation, %{}, "."}]
assert lex("> a.") == [
{:generic_prompt, %{selectable: false}, "> "},
{:string_symbol, %{}, "a"},
{:punctuation, %{}, "."}
]

assert lex("(a@b)> a.") == [
{:generic_prompt, %{selectable: false}, "(a@b)> "},
{:string_symbol, %{}, "a"},
{:punctuation, %{}, "."}
]
end

test "with number" do
assert lex("1> a.") == [{:generic_prompt, %{selectable: false}, "1> "},
{:string_symbol, %{}, "a"},
{:punctuation, %{}, "."}]
assert lex("(a@b)1> a.") == [{:generic_prompt, %{selectable: false}, "(a@b)1> "},
{:string_symbol, %{}, "a"},
{:punctuation, %{}, "."}]
assert lex("1> a.") == [
{:generic_prompt, %{selectable: false}, "1> "},
{:string_symbol, %{}, "a"},
{:punctuation, %{}, "."}
]

assert lex("(a@b)1> a.") == [
{:generic_prompt, %{selectable: false}, "(a@b)1> "},
{:string_symbol, %{}, "a"},
{:punctuation, %{}, "."}
]
end

test "greater-than still works" do
assert lex("1>2") == [{:number_integer, %{}, "1"},
{:operator, %{}, ">"},
{:number_integer, %{}, "2"}]
assert lex("1 > 2") == [{:number_integer, %{}, "1"},
{:whitespace, %{}, " "},
{:operator, %{}, ">"},
{:whitespace, %{}, " "},
{:number_integer, %{}, "2"}]
assert lex("1>2") == [
{:number_integer, %{}, "1"},
{:operator, %{}, ">"},
{:number_integer, %{}, "2"}
]

assert lex("1 > 2") == [
{:number_integer, %{}, "1"},
{:whitespace, %{}, " "},
{:operator, %{}, ">"},
{:whitespace, %{}, " "},
{:number_integer, %{}, "2"}
]
end
end
end

0 comments on commit 973ff38

Please sign in to comment.