-module('ex_8.18_implicit_block_mapping_entries').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        62,
        true,
        [],
        0,
        63,
        5,
        1,
        false,
        4,
        8,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        22,
        21,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,4,8},
          {yamerl_doc_end,4,8},
          {yamerl_collection_end,4,8,block,mapping},
          {yamerl_collection_end,4,8,block,sequence},
          {yamerl_scalar,4,3,
            {yamerl_tag,4,3,{non_specific,"?"}},
            flow,plain,"entry"},
          {yamerl_sequence_entry,4,1},
          {yamerl_collection_start,4,1,
            {yamerl_tag,4,1,{non_specific,"?"}},
            block,sequence},
          {yamerl_mapping_value,3,13},
          {yamerl_scalar,3,1,
            {yamerl_tag,3,1,{non_specific,"!"}},
            flow,double_quoted,"quoted key"},
          {yamerl_mapping_key,3,1},
          {yamerl_scalar,2,1,
            {yamerl_tag,2,1,{non_specific,"?"}},
            flow,plain,[]},
          {yamerl_mapping_value,2,1},
          {yamerl_scalar,2,1,
            {yamerl_tag,2,1,{non_specific,"?"}},
            flow,plain,[]},
          {yamerl_mapping_key,2,1},
          {yamerl_scalar,1,12,
            {yamerl_tag,1,12,{non_specific,"?"}},
            flow,plain,"in-line value"},
          {yamerl_mapping_value,1,10},
          {yamerl_scalar,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            flow,plain,"plain key"},
          {yamerl_mapping_key,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,mapping},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).

-module('ex_8.18_implicit_block_mapping_entries').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        62,
        true,
        [],
        0,
        63,
        5,
        1,
        false,
        4,
        8,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        22,
        21,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,4,8},
          {yamerl_doc_end,4,8},
          {yamerl_collection_end,4,8,block,mapping},
          {yamerl_collection_end,4,8,block,sequence},
          {yamerl_scalar,4,3,
            {yamerl_tag,4,3,{non_specific,"?"}},
            flow,plain,"entry"},
          {yamerl_sequence_entry,4,1},
          {yamerl_collection_start,4,1,
            {yamerl_tag,4,1,{non_specific,"?"}},
            block,sequence},
          {yamerl_mapping_value,3,13},
          {yamerl_scalar,3,1,
            {yamerl_tag,3,1,{non_specific,"!"}},
            flow,double_quoted,"quoted key"},
          {yamerl_mapping_key,3,1},
          {yamerl_scalar,2,1,
            {yamerl_tag,2,1,{non_specific,"?"}},
            flow,plain,[]},
          {yamerl_mapping_value,2,1},
          {yamerl_scalar,2,1,
            {yamerl_tag,2,1,{non_specific,"?"}},
            flow,plain,[]},
          {yamerl_mapping_key,2,1},
          {yamerl_scalar,1,12,
            {yamerl_tag,1,12,{non_specific,"?"}},
            flow,plain,"in-line value"},
          {yamerl_mapping_value,1,10},
          {yamerl_scalar,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            flow,plain,"plain key"},
          {yamerl_mapping_key,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,mapping},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
