2015-03-06 12:22:11 +13:00
|
|
|
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
|
2015-03-06 12:22:11 +13:00
|
|
|
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
|
2015-03-06 12:22:11 +13:00
|
|
|
assert message == "Invalid result from action: \"WAT\""
|
|
|
|
end
|
|
|
|
end
|