lex_luthor/test/rejection_test.exs

16 lines
417 B
Elixir
Raw Normal View History

defmodule RejectionTest do
use ExUnit.Case, async: true
test "string not in language fails" do
2021-01-27 10:20:18 +13:00
{status, message} = ExampleLexer.lex("{}")
assert status == :error
assert message == "String not in language: \"{}\""
end
test "bogus action" do
2021-01-27 10:20:18 +13:00
{status, message} = ExampleLexer.lex("BOGUS_ACTION")
assert status == :error
assert message == "Invalid result from action: \"WAT\""
end
end