<commit_before>use v6;

use Test;

# L<S02/Names and Variables/To get a Perlish representation of any object>

my @tests = (
    # Basic scalar values
    42, 42/10, 4.2, sqrt(2),
    #?rakudo emit # 3e5 is converted to a Str when re-evaled
    3e5,
    #?rakudo emit # Failure objects have no .perl method and +/-Inf/NaN fail
    Inf, -Inf, NaN,

    "a string", "", "\0", "\t", "\n", "\r\n", "\o7",
    #?rakudo emit # { is not escaped in '{'.perl
    '{', # "\d123",	# XXX there is no \d escape!!!
    '}',
    #?rakudo emit # sigils are not escaped in .perl
    '$a @string %with &sigils()',

    ?1, ?0,
    undef,
    #?rakudo emit # parse error
    rx:P5/foo/, rx:P5//, rx:P5/^.*$/,

    # References to scalars
    #?rakudo emit #
    \42, \Inf, \-Inf, \NaN, \"string", \"", \?1, \?0, \undef,

    (a => 1),
    :b(2),

    # References to aggregates<commit_msg>[t/spec] unfudge tests in perl.t - rakudo's Str.perl now properly escapes sigials and other stuff.<commit_after>use v6;

use Test;

# L<S02/Names and Variables/To get a Perlish representation of any object>

my @tests = (
    # Basic scalar values
    42, 42/10, 4.2, sqrt(2),
    #?rakudo emit # 3e5 is converted to a Str when re-evaled
    3e5,
    #?rakudo emit # Failure objects have no .perl method and +/-Inf/NaN fail
    Inf, -Inf, NaN,

    "a string", "", "\0", "\t", "\n", "\r\n", "\o7",
    '{', # "\d123",	# XXX there is no \d escape!!!
    '}',
    '$a @string %with &sigils()',

    ?1, ?0,
    undef,
    #?rakudo emit # parse error
    rx:P5/foo/, rx:P5//, rx:P5/^.*$/,

    # References to scalars
    #?rakudo emit #
    \42, \Inf, \-Inf, \NaN, \"string", \"", \?1, \?0, \undef,

    (a => 1),
    :b(2),

    # References to aggregates
{'fraction_non_alphanumeric': 0.1925754060324826, 'fraction_numerical': 0.037122969837587005, 'mean_word_length': 2.3430232558139537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '219066', 'n_tokens_mistral': 726, 'n_tokens_neox': 655, 'n_words': 217}