mirror of
https://github.com/valitydev/yamerl.git
synced 2024-11-06 10:55:16 +00:00
31e0453f04
References #15.
45 lines
1.0 KiB
Erlang
45 lines
1.0 KiB
Erlang
-module(unknown_alias).
|
|
|
|
-include_lib("eunit/include/eunit.hrl").
|
|
|
|
-define(FILENAME, "test/construction/" ?MODULE_STRING ".yaml").
|
|
|
|
setup() ->
|
|
application:start(yamerl).
|
|
|
|
simple_test_() ->
|
|
{setup,
|
|
fun setup/0,
|
|
[
|
|
?_assertThrow(
|
|
{yamerl_exception,
|
|
[{yamerl_parsing_error,error,
|
|
"No anchor corresponds to alias \"anchor\"",
|
|
2,3,no_matching_anchor,
|
|
{yamerl_alias,2,3,"anchor"},
|
|
[]}
|
|
]
|
|
},
|
|
yamerl_constr:file(?FILENAME, [{detailed_constr, false}])
|
|
)
|
|
]
|
|
}.
|
|
|
|
detailed_test_() ->
|
|
{setup,
|
|
fun setup/0,
|
|
[
|
|
?_assertThrow(
|
|
{yamerl_exception,
|
|
[{yamerl_parsing_error,error,
|
|
"No anchor corresponds to alias \"anchor\"",
|
|
2,3,no_matching_anchor,
|
|
{yamerl_alias,2,3,"anchor"},
|
|
[]}
|
|
]
|
|
},
|
|
yamerl_constr:file(?FILENAME, [{detailed_constr, true}])
|
|
)
|
|
]
|
|
}.
|