### ----------------------------------------------------
### -- Config::TOML
### -- Licenses: Unlicense
### -- Authors: 
### -- File: t/grammar-actions/01-primitives.rakutest
### ----------------------------------------------------
### -- Chunk 3 of 3
━━━┓
        ┃             ┃  ∙ $match-float-inf-plus.made == Inf
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-float-inf-minus.made,
        -Inf,
        q:to/EOF/
        ♪ [Is expected float value?] - 102 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-float-inf-minus.made == -Inf
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-float-nan.made,
        NaN,
        q:to/EOF/
        ♪ [Is expected float value?] - 103 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-float-nan.made == NaN
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-float-nan-plus.made,
        NaN,
        q:to/EOF/
        ♪ [Is expected float value?] - 104 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-float-nan-plus.made == NaN
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-float-nan-minus.made,
        NaN,
        q:to/EOF/
        ♪ [Is expected float value?] - 105 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-float-nan-minus.made == NaN
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
});

# --- end float tests }}}
# end number grammar-actions tests }}}
# boolean grammar-actions tests {{{

subtest({
    # Booleans are just the tokens you're used to. Always lowercase.
    my Str $bool1 = Q{true};
    my Str $bool2 = Q{false};

    my Config::TOML::Parser::Actions $actions .= new;
    my $match-bool1 =
        Config::TOML::Parser::Grammar.parse(
            $bool1,
            :$actions,
            :rule<boolean>
        );
    my $match-bool2 =
        Config::TOML::Parser::Grammar.parse(
            $bool2,
            :$actions,
            :rule<boolean>
        );

    is(
        $match-bool1.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($bool1, :rule<boolean>)] - 106 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal boolean successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-bool2.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($bool2, :rule<boolean>)] - 107 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal boolean successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );

    is(
        $match-bool1.made.WHAT,
        Bool,
        q:to/EOF/
        ♪ [Is boolean?] - 108 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-bool1.made.WHAT ~~ Bool
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-bool2.made.WHAT,
        Bool,
        q:to/EOF/
        ♪ [Is boolean?] - 109 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-bool2.made.WHAT ~~ Bool
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );

    is(
        $match-bool1.made,
        True,
        q:to/EOF/
        ♪ [Is expected boolean value?] - 110 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-bool1.made ~~ True
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-bool2.made,
        False,
        q:to/EOF/
        ♪ [Is expected boolean value?] - 111 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-bool2.made ~~ False
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
});

# end boolean grammar-actions tests }}}
# datetime grammar-actions tests {{{

subtest({
    # Datetimes are RFC 3339 dates.
    my Str $date-time1 = Q{1979-05-27T07:32:00Z};
    my Str $date-time2 = Q{1979-05-27T00:32:00-07:00};
    my Str $date-time3 = Q{1979-05-27T00:32:00.999999-07:00};
    my Str $date-time4 = Q{1979-05-27T07:32:00};
    my Str $date-time5 = Q{1979-05-27T00:32:00.999999};
    my Str $date-time6 = Q{1979-05-27 07:32:00Z};
    my Str $full-date1 = Q{1979-05-27};
    my Str $partial-time1 = Q{07:32:00};
    my Str $partial-time2 = Q{00:32:00.999999};

    # assume UTC when local offset unspecified in TOML dates
    my Config::TOML::Parser::Actions $actions .= new(:date-local-offset(0));
    my $match-date-time1 =
        Config::TOML::Parser::Grammar.parse(
            $date-time1,
            :$actions,
            :rule<date>
        );
    my $match-date-time2 =
        Config::TOML::Parser::Grammar.parse(
            $date-time2,
            :$actions,
            :rule<date>
        );
    my $match-date-time3 =
        Config::TOML::Parser::Grammar.parse(
            $date-time3,
            :$actions,
            :rule<date>
        );
    my $match-date-time4 =
        Config::TOML::Parser::Grammar.parse(
            $date-time4,
            :$actions,
            :rule<date>
        );
    my $match-date-time5 =
        Config::TOML::Parser::Grammar.parse(
            $date-time5,
            :$actions,
            :rule<date>
        );
    my $match-date-time6 =
        Config::TOML::Parser::Grammar.parse(
            $date-time6,
            :$actions,
            :rule<date>
        );
    my $match-full-date1 =
        Config::TOML::Parser::Grammar.parse(
            $full-date1,
            :$actions,
            :rule<date>
        );
    my $match-partial-time1 =
        Config::TOML::Parser::Grammar.parse(
            $partial-time1,
            :$actions,
            :rule<time>
        );
    my $match-partial-time2 =
        Config::TOML::Parser::Grammar.parse(
            $partial-time2,
            :$actions,
            :rule<time>
        );

    is(
        $match-date-time1.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($date-time1, :rule<date>)] - 112 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal datetime successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time2.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($date-time2, :rule<date>)] - 113 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal datetime successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time3.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($date-time3, :rule<date>)] - 114 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal datetime successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time4.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($date-time4, :rule<date>)] - 115 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal datetime successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time5.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($date-time5, :rule<date>)] - 116 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal datetime successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time6.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($date-time6, :rule<date>)] - 117 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal datetime successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-full-date1.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($full-date1, :rule<date>)] - 118 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal date successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time1.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($partial-time1, :rule<time>)] - 119 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal partial time successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time2.WHAT,
        Config::TOML::Parser::Grammar,
        q:to/EOF/
        ♪ [Grammar.parse($partial-time2, :rule<time>)] - 120 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ Parses string literal partial time successfully
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );

    is(
        $match-date-time1.made.WHAT,
        DateTime,
        q:to/EOF/
        ♪ [Is datetime?] - 121 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time1.made.WHAT ~~ DateTime
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time2.made.WHAT,
        DateTime,
        q:to/EOF/
        ♪ [Is datetime?] - 122 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time2.made.WHAT ~~ DateTime
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time3.made.WHAT,
        DateTime,
        q:to/EOF/
        ♪ [Is datetime?] - 123 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time3.made.WHAT ~~ DateTime
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time4.made.WHAT,
        DateTime,
        q:to/EOF/
        ♪ [Is datetime?] - 124 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time4.made.WHAT ~~ DateTime
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time5.made.WHAT,
        DateTime,
        q:to/EOF/
        ♪ [Is datetime?] - 125 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time5.made.WHAT ~~ DateTime
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time6.made.WHAT,
        DateTime,
        q:to/EOF/
        ♪ [Is datetime?] - 126 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time6.made.WHAT ~~ DateTime
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-full-date1.made.WHAT,
        Date,
        q:to/EOF/
        ♪ [Is datetime?] - 127 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-full-date1.made.WHAT ~~ Date
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time1.made.WHAT,
        Hash,
        q:to/EOF/
        ♪ [Is datetime?] - 128 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-partial-time1.made.WHAT ~~ Hash
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time2.made.WHAT,
        Hash,
        q:to/EOF/
        ♪ [Is datetime?] - 129 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-partial-time2.made.WHAT ~~ Hash
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );

    is(
        $match-date-time1.made,
        '1979-05-27T07:32:00Z',
        q:to/EOF/
        ♪ [Is expected datetime value?] - 130 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time1.made
        ┃   Success   ┃        ~~ '1979-05-27T07:32:00Z'
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time2.made,
        '1979-05-27T00:32:00-07:00',
        q:to/EOF/
        ♪ [Is expected datetime value?] - 131 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time2.made
        ┃   Success   ┃        ~~ '1979-05-27T00:32:00-07:00'
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time3.made,
        '1979-05-27T00:32:00.999999-07:00',
        q:to/EOF/
        ♪ [Is expected datetime value?] - 132 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time3.made
        ┃   Success   ┃        ~~ '1979-05-27T00:32:00.999999-07:00'
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time4.made,
        '1979-05-27T07:32:00Z',
        q:to/EOF/
        ♪ [Is expected datetime value?] - 133 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time4.made
        ┃   Success   ┃        ~~ '1979-05-27T07:32:00Z'
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time5.made,
        '1979-05-27T00:32:00.999999Z',
        q:to/EOF/
        ♪ [Is expected datetime value?] - 134 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time5.made
        ┃   Success   ┃        ~~ '1979-05-27T00:32:00.999999Z'
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-date-time6.made,
        '1979-05-27T07:32:00Z',
        q:to/EOF/
        ♪ [Is expected datetime value?] - 135 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-date-time6.made
        ┃   Success   ┃        ~~ '1979-05-27T07:32:00Z'
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-full-date1.made,
        '1979-05-27',
        q:to/EOF/
        ♪ [Is expected full date value?] - 136 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-full-date1.made ~~ '1979-05-27'
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time1.made<hour>,
        7,
        q:to/EOF/
        ♪ [Is expected partial time value?] - 137 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-partial-time1.made<hour> ~~ 7
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time1.made<minute>,
        32,
        q:to/EOF/
        ♪ [Is expected partial time value?] - 138 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-partial-time1.made<minute> ~~ 32
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time1.made<second>,
        0.0,
        q:to/EOF/
        ♪ [Is expected partial time value?] - 139 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-partial-time1.made<second> ~~ 0.0
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time2.made<hour>,
        0,
        q:to/EOF/
        ♪ [Is expected partial time value?] - 140 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-partial-time2.made<hour> ~~ 0
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time2.made<minute>,
        32,
        q:to/EOF/
        ♪ [Is expected partial time value?] - 141 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-partial-time2.made<minute> ~~ 32
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
    is(
        $match-partial-time2.made<second>,
        0.999999,
        q:to/EOF/
        ♪ [Is expected partial time value?] - 142 of 142
        ┏━━━━━━━━━━━━━┓
        ┃             ┃  ∙ $match-partial-time2.made<second> ~~ 0.999999
        ┃   Success   ┃
        ┃             ┃
        ┗━━━━━━━━━━━━━┛
        EOF
    );
});

# end datetime grammar-actions tests }}}

# vim: expandtab shiftwidth=4


