const std = @import("std");
const mem = std.mem;
const testing = std.testing;

const Language = @import("language.zig");
const Tokenizer = @import("tokenizer.zig");

const allocator = std.testing.allocator;

test Language {
    const text =
        \\  {
        \\      "cute": true,
        \\      "metadata": {
        \\          "post": [1,2,3,{"uwu":1}],
        \\          "a": 2,
        \\          "c": {
        \\              "d": 4,
        \\              "uwua": [[[[[1], [2]]]]],
        \\              "x": true
        \\          }
        \\      },
        \\      "b": 3
        \\  }
    ;

    var tokenizer: Tokenizer = try .init(allocator, text);
    defer tokenizer.deinit(allocator);

    var self = try allocator.create(Language);
    defer allocator.destroy(self);
    self.* = Language.init;
    defer self.deinit(allocator);

    const idx: usize = try self.parse(allocator, &tokenizer);

    var root = try self.getValue(allocator, idx);
    defer root.deinit(allocator);

    try std.testing.expect(root == .object);
    std.debug.print("{}\n", .{root});
}

test {
    _ = @import("language.zig");
    _ = @import("strings.zig");
    _ = @import("tokenizer.zig");
    _ = @import("reflection.zig");
}

fn expectPass(comptime path: []const u8) !void {
    const file = @embedFile("tests/" ++ path);

    var tokenizer: Tokenizer = try .init(allocator, file);
    defer tokenizer.deinit(allocator);

    var self = try allocator.create(Language);
    self.* = Language.init;
    defer allocator.destroy(self);
    defer self.deinit(allocator);

    const idx: usize = try self.parse(allocator, &tokenizer);

    var root = try self.getValue(allocator, idx);
    defer root.deinit(allocator);

    std.debug.print("{}\n", .{root});
}

fn expectFail(comptime path: []const u8) !void {
    const file = @embedFile("tests/" ++ path);

    var tokenizer: Tokenizer = try .init(allocator, file);
    defer tokenizer.deinit(allocator);

    var self = try allocator.create(Language);
    self.* = Language.init;
    defer allocator.destroy(self);
    defer self.deinit(allocator);

    const idx: usize = self.parse(allocator, &tokenizer) catch
        return;
    var root = self.getValue(allocator, idx) catch
        return;
    defer root.deinit(allocator);
}
// zig fmt: off

test { try expectFail( "n_array_1_true_without_comma.json" ); }
test { try expectFail( "n_array_a_invalid_utf8.json" ); }
test { try expectFail( "n_array_colon_instead_of_comma.json" ); }
test { try expectFail( "n_array_comma_after_close.json" ); }
test { try expectFail( "n_array_comma_and_number.json" ); }
test { try expectFail( "n_array_double_comma.json" ); }
test { try expectFail( "n_array_double_extra_comma.json" ); }
test { try expectFail( "n_array_extra_close.json" ); }
test { try expectFail( "n_array_extra_comma.json" ); }
test { try expectFail( "n_array_incomplete.json" ); }
test { try expectFail( "n_array_incomplete_invalid_value.json" ); }
test { try expectFail( "n_array_inner_array_no_comma.json" ); }
test { try expectFail( "n_array_invalid_utf8.json" ); }
test { try expectFail( "n_array_items_separated_by_semicolon.json" ); }
test { try expectFail( "n_array_just_comma.json" ); }
test { try expectFail( "n_array_just_minus.json" ); }
test { try expectFail( "n_array_missing_value.json" ); }
test { try expectFail( "n_array_newlines_unclosed.json" ); }
test { try expectFail( "n_array_number_and_comma.json" ); }
test { try expectFail( "n_array_number_and_several_commas.json" ); }
test { try expectFail( "n_array_spaces_vertical_tab_formfeed.json" ); }
test { try expectFail( "n_array_star_inside.json" ); }
test { try expectFail( "n_array_unclosed.json" ); }
test { try expectFail( "n_array_unclosed_trailing_comma.json" ); }
test { try expectFail( "n_array_unclosed_with_new_lines.json" ); }
test { try expectFail( "n_array_unclosed_with_object_inside.json" ); }
test { try expectFail( "n_incomplete_false.json" ); }
test { try expectFail( "n_incomplete_null.json" ); }
test { try expectFail( "n_incomplete_true.json" ); }
test { try expectFail( "n_multidigit_number_then_00.json" ); }
test { try expectFail( "n_number_++.json" ); }
test { try expectFail( "n_number_+1.json" ); }
test { try expectFail( "n_number_+Inf.json" ); }
test { try expectFail( "n_number_-01.json" ); }
test { try expectFail( "n_number_-1.0..json" ); }
test { try expectFail( "n_number_-2..json" ); }
test { try expectFail( "n_number_-NaN.json" ); }
test { try expectFail( "n_number_.-1.json" ); }
test { try expectFail( "n_number_.2e-3.json" ); }
test { try expectFail( "n_number_0.1.2.json" ); }
test { try expectFail( "n_number_0.3e+.json" ); }
test { try expectFail( "n_number_0.3e.json" ); }
test { try expectFail( "n_number_0.e1.json" ); }
test { try expectFail( "n_number_0_capital_E+.json" ); }
test { try expectFail( "n_number_0_capital_E.json" ); }
test { try expectFail( "n_number_0e+.json" ); }
test { try expectFail( "n_number_0e.json" ); }
test { try expectFail( "n_number_1.0e+.json" ); }
test { try expectFail( "n_number_1.0e-.json" ); }
test { try expectFail( "n_number_1.0e.json" ); }
test { try expectFail( "n_number_1_000.json" ); }
test { try expectFail( "n_number_1eE2.json" ); }
test { try expectFail( "n_number_2.e+3.json" ); }
test { try expectFail( "n_number_2.e-3.json" ); }
test { try expectFail( "n_number_2.e3.json" ); }
test { try expectFail( "n_number_9.e+.json" ); }
test { try expectFail( "n_number_Inf.json" ); }
test { try expectFail( "n_number_NaN.json" ); }
test { try expectFail( "n_number_U+FF11_fullwidth_digit_one.json" ); }
test { try expectFail( "n_number_expression.json" ); }
test { try expectFail( "n_number_hex_1_digit.json" ); }
test { try expectFail( "n_number_hex_2_digits.json" ); }
test { try expectFail( "n_number_infinity.json" ); }
test { try expectFail( "n_number_invalid+-.json" ); }
test { try expectFail( "n_number_invalid-negative-real.json" ); }
test { try expectFail( "n_number_invalid-utf-8-in-bigger-int.json" ); }
test { try expectFail( "n_number_invalid-utf-8-in-exponent.json" ); }
test { try expectFail( "n_number_invalid-utf-8-in-int.json" ); }
test { try expectFail( "n_number_minus_infinity.json" ); }
test { try expectFail( "n_number_minus_sign_with_trailing_garbage.json" ); }
test { try expectFail( "n_number_minus_space_1.json" ); }
test { try expectFail( "n_number_neg_int_starting_with_zero.json" ); }
test { try expectFail( "n_number_neg_real_without_int_part.json" ); }
test { try expectFail( "n_number_neg_with_garbage_at_end.json" ); }
test { try expectFail( "n_number_real_garbage_after_e.json" ); }
test { try expectFail( "n_number_real_with_invalid_utf8_after_e.json" ); }
test { try expectFail( "n_number_real_without_fractional_part.json" ); }
test { try expectFail( "n_number_starting_with_dot.json" ); }
test { try expectFail( "n_number_with_alpha.json" ); }
test { try expectFail( "n_number_with_alpha_char.json" ); }
test { try expectFail( "n_number_with_leading_zero.json" ); }
test { try expectFail( "n_object_bad_value.json" ); }
test { try expectFail( "n_object_bracket_key.json" ); }
test { try expectFail( "n_object_comma_instead_of_colon.json" ); }
test { try expectFail( "n_object_double_colon.json" ); }
test { try expectFail( "n_object_emoji.json" ); }
test { try expectFail( "n_object_garbage_at_end.json" ); }
test { try expectFail( "n_object_key_with_single_quotes.json" ); }
test { try expectFail( "n_object_lone_continuation_byte_in_key_and_trailing_comma.json" ); }
test { try expectFail( "n_object_missing_colon.json" ); }
test { try expectFail( "n_object_missing_key.json" ); }
test { try expectFail( "n_object_missing_semicolon.json" ); }
test { try expectFail( "n_object_missing_value.json" ); }
test { try expectFail( "n_object_no-colon.json" ); }
test { try expectFail( "n_object_non_string_key.json" ); }
test { try expectFail( "n_object_non_string_key_but_huge_number_instead.json" ); }
test { try expectFail( "n_object_repeated_null_null.json" ); }
test { try expectFail( "n_object_several_trailing_commas.json" ); }
test { try expectFail( "n_object_single_quote.json" ); }
test { try expectFail( "n_object_trailing_comma.json" ); }
test { try expectFail( "n_object_trailing_comment.json" ); }
test { try expectFail( "n_object_trailing_comment_open.json" ); }
test { try expectFail( "n_object_trailing_comment_slash_open.json" ); }
test { try expectFail( "n_object_trailing_comment_slash_open_incomplete.json" ); }
test { try expectFail( "n_object_two_commas_in_a_row.json" ); }
test { try expectFail( "n_object_unquoted_key.json" ); }
test { try expectFail( "n_object_unterminated-value.json" ); }
test { try expectFail( "n_object_with_single_string.json" ); }
test { try expectFail( "n_object_with_trailing_garbage.json" ); }
test { try expectFail( "n_single_space.json" ); }
test { try expectFail( "n_string_1_surrogate_then_escape.json" ); }
test { try expectFail( "n_string_1_surrogate_then_escape_u.json" ); }
test { try expectFail( "n_string_1_surrogate_then_escape_u1.json" ); }
test { try expectFail( "n_string_1_surrogate_then_escape_u1x.json" ); }
test { try expectFail( "n_string_accentuated_char_no_quotes.json" ); }
test { try expectFail( "n_string_backslash_00.json" ); }
test { try expectFail( "n_string_escape_x.json" ); }
test { try expectFail( "n_string_escaped_backslash_bad.json" ); }
test { try expectFail( "n_string_escaped_ctrl_char_tab.json" ); }
test { try expectFail( "n_string_escaped_emoji.json" ); }
test { try expectFail( "n_string_incomplete_escape.json" ); }
test { try expectFail( "n_string_incomplete_escaped_character.json" ); }
test { try expectFail( "n_string_incomplete_surrogate.json" ); }
test { try expectFail( "n_string_incomplete_surrogate_escape_invalid.json" ); }
test { try expectFail( "n_string_invalid-utf-8-in-escape.json" ); }
test { try expectFail( "n_string_invalid_backslash_esc.json" ); }
test { try expectFail( "n_string_invalid_unicode_escape.json" ); }
test { try expectFail( "n_string_invalid_utf8_after_escape.json" ); }
test { try expectFail( "n_string_leading_uescaped_thinspace.json" ); }
test { try expectFail( "n_string_no_quotes_with_bad_escape.json" ); }
test { try expectFail( "n_string_single_doublequote.json" ); }
test { try expectFail( "n_string_single_quote.json" ); }
test { try expectFail( "n_string_single_string_no_double_quotes.json" ); }
test { try expectFail( "n_string_start_escape_unclosed.json" ); }
test { try expectFail( "n_string_unescaped_ctrl_char.json" ); }
test { try expectFail( "n_string_unescaped_newline.json" ); }
test { try expectFail( "n_string_unescaped_tab.json" ); }
test { try expectFail( "n_string_unicode_CapitalU.json" ); }
test { try expectFail( "n_string_with_trailing_garbage.json" ); }
test { try expectFail( "n_structure_100000_opening_arrays.json" ); }
test { try expectFail( "n_structure_U+2060_word_joined.json" ); }
test { try expectFail( "n_structure_UTF8_BOM_no_data.json" ); }
test { try expectFail( "n_structure_angle_bracket_..json" ); }
test { try expectFail( "n_structure_angle_bracket_null.json" ); }
test { try expectFail( "n_structure_array_trailing_garbage.json" ); }
test { try expectFail( "n_structure_array_with_extra_array_close.json" ); }
test { try expectFail( "n_structure_array_with_unclosed_string.json" ); }
test { try expectFail( "n_structure_ascii-unicode-identifier.json" ); }
test { try expectFail( "n_structure_capitalized_True.json" ); }
test { try expectFail( "n_structure_close_unopened_array.json" ); }
test { try expectFail( "n_structure_comma_instead_of_closing_brace.json" ); }
test { try expectFail( "n_structure_double_array.json" ); }
test { try expectFail( "n_structure_end_array.json" ); }
test { try expectFail( "n_structure_incomplete_UTF8_BOM.json" ); }
test { try expectFail( "n_structure_lone-invalid-utf-8.json" ); }
test { try expectFail( "n_structure_lone-open-bracket.json" ); }
test { try expectFail( "n_structure_no_data.json" ); }
test { try expectFail( "n_structure_null-byte-outside-string.json" ); }
test { try expectFail( "n_structure_number_with_trailing_garbage.json" ); }
test { try expectFail( "n_structure_object_followed_by_closing_object.json" ); }
test { try expectFail( "n_structure_object_unclosed_no_value.json" ); }
test { try expectFail( "n_structure_object_with_comment.json" ); }
test { try expectFail( "n_structure_object_with_trailing_garbage.json" ); }
test { try expectFail( "n_structure_open_array_apostrophe.json" ); }
test { try expectFail( "n_structure_open_array_comma.json" ); }
test { try expectFail( "n_structure_open_array_object.json" ); }
test { try expectFail( "n_structure_open_array_open_object.json" ); }
test { try expectFail( "n_structure_open_array_open_string.json" ); }
test { try expectFail( "n_structure_open_array_string.json" ); }
test { try expectFail( "n_structure_open_object.json" ); }
test { try expectFail( "n_structure_open_object_close_array.json" ); }
test { try expectFail( "n_structure_open_object_comma.json" ); }
test { try expectFail( "n_structure_open_object_open_array.json" ); }
test { try expectFail( "n_structure_open_object_open_string.json" ); }
test { try expectFail( "n_structure_open_object_string_with_apostrophes.json" ); }
test { try expectFail( "n_structure_open_open.json" ); }
test { try expectFail( "n_structure_single_eacute.json" ); }
test { try expectFail( "n_structure_single_star.json" ); }
test { try expectFail( "n_structure_trailing_#.json" ); }
test { try expectFail( "n_structure_uescaped_LF_before_string.json" ); }
test { try expectFail( "n_structure_unclosed_array.json" ); }
test { try expectFail( "n_structure_unclosed_array_partial_null.json" ); }
test { try expectFail( "n_structure_unclosed_array_unfinished_false.json" ); }
test { try expectFail( "n_structure_unclosed_array_unfinished_true.json" ); }
test { try expectFail( "n_structure_unclosed_object.json" ); }
test { try expectFail( "n_structure_unicode-identifier.json" ); }
test { try expectFail( "n_structure_whitespace_U+2060_word_joiner.json" ); }
test { try expectFail( "n_structure_whitespace_formfeed.json" ); }
test { try expectFail( "n_array_1_true_without_comma.json" ); }
test { try expectFail( "n_array_a_invalid_utf8.json" ); }
test { try expectFail( "n_array_colon_instead_of_comma.json" ); }
test { try expectFail( "n_array_comma_after_close.json" ); }
test { try expectFail( "n_array_comma_and_number.json" ); }
test { try expectFail( "n_array_double_comma.json" ); }
test { try expectFail( "n_array_double_extra_comma.json" ); }
test { try expectFail( "n_array_extra_close.json" ); }
test { try expectFail( "n_array_extra_comma.json" ); }
test { try expectFail( "n_array_incomplete.json" ); }
test { try expectFail( "n_array_incomplete_invalid_value.json" ); }
test { try expectFail( "n_array_inner_array_no_comma.json" ); }
test { try expectFail( "n_array_invalid_utf8.json" ); }
test { try expectFail( "n_array_items_separated_by_semicolon.json" ); }
test { try expectFail( "n_array_just_comma.json" ); }
test { try expectFail( "n_array_just_minus.json" ); }
test { try expectFail( "n_array_missing_value.json" ); }
test { try expectFail( "n_array_newlines_unclosed.json" ); }
test { try expectFail( "n_array_number_and_comma.json" ); }
test { try expectFail( "n_array_number_and_several_commas.json" ); }
test { try expectFail( "n_array_spaces_vertical_tab_formfeed.json" ); }
test { try expectFail( "n_array_star_inside.json" ); }
test { try expectFail( "n_array_unclosed.json" ); }
test { try expectFail( "n_array_unclosed_trailing_comma.json" ); }
test { try expectFail( "n_array_unclosed_with_new_lines.json" ); }
test { try expectFail( "n_array_unclosed_with_object_inside.json" ); }
test { try expectFail( "n_incomplete_false.json" ); }
test { try expectFail( "n_incomplete_null.json" ); }
test { try expectFail( "n_incomplete_true.json" ); }
test { try expectFail( "n_multidigit_number_then_00.json" ); }
test { try expectFail( "n_number_++.json" ); }
test { try expectFail( "n_number_+1.json" ); }
test { try expectFail( "n_number_+Inf.json" ); }
test { try expectFail( "n_number_-01.json" ); }
test { try expectFail( "n_number_-1.0..json" ); }
test { try expectFail( "n_number_-2..json" ); }
test { try expectFail( "n_number_-NaN.json" ); }
test { try expectFail( "n_number_.-1.json" ); }
test { try expectFail( "n_number_.2e-3.json" ); }
test { try expectFail( "n_number_0.1.2.json" ); }
test { try expectFail( "n_number_0.3e+.json" ); }
test { try expectFail( "n_number_0.3e.json" ); }
test { try expectFail( "n_number_0.e1.json" ); }
test { try expectFail( "n_number_0_capital_E+.json" ); }
test { try expectFail( "n_number_0_capital_E.json" ); }
test { try expectFail( "n_number_0e+.json" ); }
test { try expectFail( "n_number_0e.json" ); }
test { try expectFail( "n_number_1.0e+.json" ); }
test { try expectFail( "n_number_1.0e-.json" ); }
test { try expectFail( "n_number_1.0e.json" ); }
test { try expectFail( "n_number_1_000.json" ); }
test { try expectFail( "n_number_1eE2.json" ); }
test { try expectFail( "n_number_2.e+3.json" ); }
test { try expectFail( "n_number_2.e-3.json" ); }
test { try expectFail( "n_number_2.e3.json" ); }
test { try expectFail( "n_number_9.e+.json" ); }
test { try expectFail( "n_number_Inf.json" ); }
test { try expectFail( "n_number_NaN.json" ); }
test { try expectFail( "n_number_U+FF11_fullwidth_digit_one.json" ); }
test { try expectFail( "n_number_expression.json" ); }
test { try expectFail( "n_number_hex_1_digit.json" ); }
test { try expectFail( "n_number_hex_2_digits.json" ); }
test { try expectFail( "n_number_infinity.json" ); }
test { try expectFail( "n_number_invalid+-.json" ); }
test { try expectFail( "n_number_invalid-negative-real.json" ); }
test { try expectFail( "n_number_invalid-utf-8-in-bigger-int.json" ); }
test { try expectFail( "n_number_invalid-utf-8-in-exponent.json" ); }
test { try expectFail( "n_number_invalid-utf-8-in-int.json" ); }
test { try expectFail( "n_number_minus_infinity.json" ); }
test { try expectFail( "n_number_minus_sign_with_trailing_garbage.json" ); }
test { try expectFail( "n_number_minus_space_1.json" ); }
test { try expectFail( "n_number_neg_int_starting_with_zero.json" ); }
test { try expectFail( "n_number_neg_real_without_int_part.json" ); }
test { try expectFail( "n_number_neg_with_garbage_at_end.json" ); }
test { try expectFail( "n_number_real_garbage_after_e.json" ); }
test { try expectFail( "n_number_real_with_invalid_utf8_after_e.json" ); }
test { try expectFail( "n_number_real_without_fractional_part.json" ); }
test { try expectFail( "n_number_starting_with_dot.json" ); }
test { try expectFail( "n_number_with_alpha.json" ); }
test { try expectFail( "n_number_with_alpha_char.json" ); }
test { try expectFail( "n_number_with_leading_zero.json" ); }
test { try expectFail( "n_object_bad_value.json" ); }
test { try expectFail( "n_object_bracket_key.json" ); }
test { try expectFail( "n_object_comma_instead_of_colon.json" ); }
test { try expectFail( "n_object_double_colon.json" ); }
test { try expectFail( "n_object_emoji.json" ); }
test { try expectFail( "n_object_garbage_at_end.json" ); }
test { try expectFail( "n_object_key_with_single_quotes.json" ); }
test { try expectFail( "n_object_lone_continuation_byte_in_key_and_trailing_comma.json" ); }
test { try expectFail( "n_object_missing_colon.json" ); }
test { try expectFail( "n_object_missing_key.json" ); }
test { try expectFail( "n_object_missing_semicolon.json" ); }
test { try expectFail( "n_object_missing_value.json" ); }
test { try expectFail( "n_object_no-colon.json" ); }
test { try expectFail( "n_object_non_string_key.json" ); }
test { try expectFail( "n_object_non_string_key_but_huge_number_instead.json" ); }
test { try expectFail( "n_object_repeated_null_null.json" ); }
test { try expectFail( "n_object_several_trailing_commas.json" ); }
test { try expectFail( "n_object_single_quote.json" ); }
test { try expectFail( "n_object_trailing_comma.json" ); }
test { try expectFail( "n_object_trailing_comment.json" ); }
test { try expectFail( "n_object_trailing_comment_open.json" ); }
test { try expectFail( "n_object_trailing_comment_slash_open.json" ); }
test { try expectFail( "n_object_trailing_comment_slash_open_incomplete.json" ); }
test { try expectFail( "n_object_two_commas_in_a_row.json" ); }
test { try expectFail( "n_object_unquoted_key.json" ); }
test { try expectFail( "n_object_unterminated-value.json" ); }
test { try expectFail( "n_object_with_single_string.json" ); }
test { try expectFail( "n_object_with_trailing_garbage.json" ); }
test { try expectFail( "n_single_space.json" ); }
test { try expectFail( "n_string_1_surrogate_then_escape.json" ); }
test { try expectFail( "n_string_1_surrogate_then_escape_u.json" ); }
test { try expectFail( "n_string_1_surrogate_then_escape_u1.json" ); }
test { try expectFail( "n_string_1_surrogate_then_escape_u1x.json" ); }
test { try expectFail( "n_string_accentuated_char_no_quotes.json" ); }
test { try expectFail( "n_string_backslash_00.json" ); }
test { try expectFail( "n_string_escape_x.json" ); }
test { try expectFail( "n_string_escaped_backslash_bad.json" ); }
test { try expectFail( "n_string_escaped_ctrl_char_tab.json" ); }
test { try expectFail( "n_string_escaped_emoji.json" ); }
test { try expectFail( "n_string_incomplete_escape.json" ); }
test { try expectFail( "n_string_incomplete_escaped_character.json" ); }
test { try expectFail( "n_string_incomplete_surrogate.json" ); }
test { try expectFail( "n_string_incomplete_surrogate_escape_invalid.json" ); }
test { try expectFail( "n_string_invalid-utf-8-in-escape.json" ); }
test { try expectFail( "n_string_invalid_backslash_esc.json" ); }
test { try expectFail( "n_string_invalid_unicode_escape.json" ); }
test { try expectFail( "n_string_invalid_utf8_after_escape.json" ); }
test { try expectFail( "n_string_leading_uescaped_thinspace.json" ); }
test { try expectFail( "n_string_no_quotes_with_bad_escape.json" ); }
test { try expectFail( "n_string_single_doublequote.json" ); }
test { try expectFail( "n_string_single_quote.json" ); }
test { try expectFail( "n_string_single_string_no_double_quotes.json" ); }
test { try expectFail( "n_string_start_escape_unclosed.json" ); }
test { try expectFail( "n_string_unescaped_ctrl_char.json" ); }
test { try expectFail( "n_string_unescaped_newline.json" ); }
test { try expectFail( "n_string_unescaped_tab.json" ); }
test { try expectFail( "n_string_unicode_CapitalU.json" ); }
test { try expectFail( "n_string_with_trailing_garbage.json" ); }
test { try expectFail( "n_structure_100000_opening_arrays.json" ); }
test { try expectFail( "n_structure_U+2060_word_joined.json" ); }
test { try expectFail( "n_structure_UTF8_BOM_no_data.json" ); }
test { try expectFail( "n_structure_angle_bracket_..json" ); }
test { try expectFail( "n_structure_angle_bracket_null.json" ); }
test { try expectFail( "n_structure_array_trailing_garbage.json" ); }
test { try expectFail( "n_structure_array_with_extra_array_close.json" ); }
test { try expectFail( "n_structure_array_with_unclosed_string.json" ); }
test { try expectFail( "n_structure_ascii-unicode-identifier.json" ); }
test { try expectFail( "n_structure_capitalized_True.json" ); }
test { try expectFail( "n_structure_close_unopened_array.json" ); }
test { try expectFail( "n_structure_comma_instead_of_closing_brace.json" ); }
test { try expectFail( "n_structure_double_array.json" ); }
test { try expectFail( "n_structure_end_array.json" ); }
test { try expectFail( "n_structure_incomplete_UTF8_BOM.json" ); }
test { try expectFail( "n_structure_lone-invalid-utf-8.json" ); }
test { try expectFail( "n_structure_lone-open-bracket.json" ); }
test { try expectFail( "n_structure_no_data.json" ); }
test { try expectFail( "n_structure_null-byte-outside-string.json" ); }
test { try expectFail( "n_structure_number_with_trailing_garbage.json" ); }
test { try expectFail( "n_structure_object_followed_by_closing_object.json" ); }
test { try expectFail( "n_structure_object_unclosed_no_value.json" ); }
test { try expectFail( "n_structure_object_with_comment.json" ); }
test { try expectFail( "n_structure_object_with_trailing_garbage.json" ); }
test { try expectFail( "n_structure_open_array_apostrophe.json" ); }
test { try expectFail( "n_structure_open_array_comma.json" ); }
test { try expectFail( "n_structure_open_array_object.json" ); }
test { try expectFail( "n_structure_open_array_open_object.json" ); }
test { try expectFail( "n_structure_open_array_open_string.json" ); }
test { try expectFail( "n_structure_open_array_string.json" ); }
test { try expectFail( "n_structure_open_object.json" ); }
test { try expectFail( "n_structure_open_object_close_array.json" ); }
test { try expectFail( "n_structure_open_object_comma.json" ); }
test { try expectFail( "n_structure_open_object_open_array.json" ); }
test { try expectFail( "n_structure_open_object_open_string.json" ); }
test { try expectFail( "n_structure_open_object_string_with_apostrophes.json" ); }
test { try expectFail( "n_structure_open_open.json" ); }
test { try expectFail( "n_structure_single_eacute.json" ); }
test { try expectFail( "n_structure_single_star.json" ); }
test { try expectFail( "n_structure_trailing_#.json" ); }
test { try expectFail( "n_structure_uescaped_LF_before_string.json" ); }
test { try expectFail( "n_structure_unclosed_array.json" ); }
test { try expectFail( "n_structure_unclosed_array_partial_null.json" ); }
test { try expectFail( "n_structure_unclosed_array_unfinished_false.json" ); }
test { try expectFail( "n_structure_unclosed_array_unfinished_true.json" ); }
test { try expectFail( "n_structure_unclosed_object.json" ); }
test { try expectFail( "n_structure_unicode-identifier.json" ); }
test { try expectFail( "n_structure_whitespace_U+2060_word_joiner.json" ); }
test { try expectFail( "n_structure_whitespace_formfeed.json" ); }
test { try expectPass( "y_array_arraysWithSpaces.json" ); }
test { try expectPass( "y_array_empty-string.json" ); }
test { try expectPass( "y_array_empty.json" ); }
test { try expectPass( "y_array_ending_with_newline.json" ); }
test { try expectPass( "y_array_false.json" ); }
test { try expectPass( "y_array_heterogeneous.json" ); }
test { try expectPass( "y_array_null.json" ); }
test { try expectPass( "y_array_with_1_and_newline.json" ); }
test { try expectPass( "y_array_with_leading_space.json" ); }
test { try expectPass( "y_array_with_several_null.json" ); }
test { try expectPass( "y_array_with_trailing_space.json" ); }
test { try expectPass( "y_number.json" ); }
test { try expectPass( "y_number_0e+1.json" ); }
test { try expectPass( "y_number_0e1.json" ); }
test { try expectPass( "y_number_after_space.json" ); }
test { try expectPass( "y_number_double_close_to_zero.json" ); }
test { try expectPass( "y_number_int_with_exp.json" ); }
test { try expectPass( "y_number_minus_zero.json" ); }
test { try expectPass( "y_number_negative_int.json" ); }
test { try expectPass( "y_number_negative_one.json" ); }
test { try expectPass( "y_number_negative_zero.json" ); }
test { try expectPass( "y_number_real_capital_e.json" ); }
test { try expectPass( "y_number_real_capital_e_neg_exp.json" ); }
test { try expectPass( "y_number_real_capital_e_pos_exp.json" ); }
test { try expectPass( "y_number_real_exponent.json" ); }
test { try expectPass( "y_number_real_fraction_exponent.json" ); }
test { try expectPass( "y_number_real_neg_exp.json" ); }
test { try expectPass( "y_number_real_pos_exponent.json" ); }
test { try expectPass( "y_number_simple_int.json" ); }
test { try expectPass( "y_number_simple_real.json" ); }
test { try expectPass( "y_object.json" ); }
test { try expectPass( "y_object_basic.json" ); }
test { try expectPass( "y_object_duplicated_key.json" ); }
test { try expectPass( "y_object_duplicated_key_and_value.json" ); }
test { try expectPass( "y_object_empty.json" ); }
test { try expectPass( "y_object_empty_key.json" ); }
test { try expectPass( "y_object_escaped_null_in_key.json" ); }
test { try expectPass( "y_object_extreme_numbers.json" ); }
test { try expectPass( "y_object_long_strings.json" ); }
test { try expectPass( "y_object_simple.json" ); }
test { try expectPass( "y_object_string_unicode.json" ); }
test { try expectPass( "y_object_with_newlines.json" ); }
test { try expectPass( "y_string_1_2_3_bytes_UTF-8_sequences.json" ); }
test { try expectPass( "y_string_accepted_surrogate_pair.json" ); }
test { try expectPass( "y_string_accepted_surrogate_pairs.json" ); }
test { try expectPass( "y_string_allowed_escapes.json" ); }
test { try expectPass( "y_string_backslash_and_u_escaped_zero.json" ); }
test { try expectPass( "y_string_backslash_doublequotes.json" ); }
test { try expectPass( "y_string_comments.json" ); }
test { try expectPass( "y_string_double_escape_a.json" ); }
test { try expectPass( "y_string_double_escape_n.json" ); }
test { try expectPass( "y_string_escaped_control_character.json" ); }
test { try expectPass( "y_string_escaped_noncharacter.json" ); }
test { try expectPass( "y_string_in_array.json" ); }
test { try expectPass( "y_string_in_array_with_leading_space.json" ); }
test { try expectPass( "y_string_last_surrogates_1_and_2.json" ); }
test { try expectPass( "y_string_nbsp_uescaped.json" ); }
test { try expectPass( "y_string_nonCharacterInUTF-8_U+10FFFF.json" ); }
test { try expectPass( "y_string_nonCharacterInUTF-8_U+FFFF.json" ); }
test { try expectPass( "y_string_null_escape.json" ); }
test { try expectPass( "y_string_one-byte-utf-8.json" ); }
test { try expectPass( "y_string_pi.json" ); }
test { try expectPass( "y_string_reservedCharacterInUTF-8_U+1BFFF.json" ); }
test { try expectPass( "y_string_simple_ascii.json" ); }
test { try expectPass( "y_string_space.json" ); }
test { try expectPass( "y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json" ); }
test { try expectPass( "y_string_three-byte-utf-8.json" ); }
test { try expectPass( "y_string_two-byte-utf-8.json" ); }
test { try expectPass( "y_string_u+2028_line_sep.json" ); }
test { try expectPass( "y_string_u+2029_par_sep.json" ); }
test { try expectPass( "y_string_uEscape.json" ); }
test { try expectPass( "y_string_uescaped_newline.json" ); }
test { try expectPass( "y_string_unescaped_char_delete.json" ); }
test { try expectPass( "y_string_unicode.json" ); }
test { try expectPass( "y_string_unicodeEscapedBackslash.json" ); }
test { try expectPass( "y_string_unicode_2.json" ); }
test { try expectPass( "y_string_unicode_U+10FFFE_nonchar.json" ); }
test { try expectPass( "y_string_unicode_U+1FFFE_nonchar.json" ); }
test { try expectPass( "y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json" ); }
test { try expectPass( "y_string_unicode_U+2064_invisible_plus.json" ); }
test { try expectPass( "y_string_unicode_U+FDD0_nonchar.json" ); }
test { try expectPass( "y_string_unicode_U+FFFE_nonchar.json" ); }
test { try expectPass( "y_string_unicode_escaped_double_quote.json" ); }
test { try expectPass( "y_string_utf8.json" ); }
test { try expectPass( "y_string_with_del_character.json" ); }
test { try expectPass( "y_structure_lonely_false.json" ); }
test { try expectPass( "y_structure_lonely_int.json" ); }
test { try expectPass( "y_structure_lonely_negative_real.json" ); }
test { try expectPass( "y_structure_lonely_null.json" ); }
test { try expectPass( "y_structure_lonely_string.json" ); }
test { try expectPass( "y_structure_lonely_true.json" ); }
test { try expectPass( "y_structure_string_empty.json" ); }
test { try expectPass( "y_structure_trailing_newline.json" ); }
test { try expectPass( "y_structure_true_in_array.json" ); }
test { try expectPass( "y_structure_whitespace_array.json" ); }
test { try expectPass( "y_array_arraysWithSpaces.json" ); }
test { try expectPass( "y_array_empty-string.json" ); }
test { try expectPass( "y_array_empty.json" ); }
test { try expectPass( "y_array_ending_with_newline.json" ); }
test { try expectPass( "y_array_false.json" ); }
test { try expectPass( "y_array_heterogeneous.json" ); }
test { try expectPass( "y_array_null.json" ); }
test { try expectPass( "y_array_with_1_and_newline.json" ); }
test { try expectPass( "y_array_with_leading_space.json" ); }
test { try expectPass( "y_array_with_several_null.json" ); }
test { try expectPass( "y_array_with_trailing_space.json" ); }
test { try expectPass( "y_number.json" ); }
test { try expectPass( "y_number_0e+1.json" ); }
test { try expectPass( "y_number_0e1.json" ); }
test { try expectPass( "y_number_after_space.json" ); }
test { try expectPass( "y_number_double_close_to_zero.json" ); }
test { try expectPass( "y_number_int_with_exp.json" ); }
test { try expectPass( "y_number_minus_zero.json" ); }
test { try expectPass( "y_number_negative_int.json" ); }
test { try expectPass( "y_number_negative_one.json" ); }
test { try expectPass( "y_number_negative_zero.json" ); }
test { try expectPass( "y_number_real_capital_e.json" ); }
test { try expectPass( "y_number_real_capital_e_neg_exp.json" ); }
test { try expectPass( "y_number_real_capital_e_pos_exp.json" ); }
test { try expectPass( "y_number_real_exponent.json" ); }
test { try expectPass( "y_number_real_fraction_exponent.json" ); }
test { try expectPass( "y_number_real_neg_exp.json" ); }
test { try expectPass( "y_number_real_pos_exponent.json" ); }
test { try expectPass( "y_number_simple_int.json" ); }
test { try expectPass( "y_number_simple_real.json" ); }
test { try expectPass( "y_object.json" ); }
test { try expectPass( "y_object_basic.json" ); }
test { try expectPass( "y_object_duplicated_key.json" ); }
test { try expectPass( "y_object_duplicated_key_and_value.json" ); }
test { try expectPass( "y_object_empty.json" ); }
test { try expectPass( "y_object_empty_key.json" ); }
test { try expectPass( "y_object_escaped_null_in_key.json" ); }
test { try expectPass( "y_object_extreme_numbers.json" ); }
test { try expectPass( "y_object_long_strings.json" ); }
test { try expectPass( "y_object_simple.json" ); }
test { try expectPass( "y_object_string_unicode.json" ); }
test { try expectPass( "y_object_with_newlines.json" ); }
test { try expectPass( "y_string_1_2_3_bytes_UTF-8_sequences.json" ); }
test { try expectPass( "y_string_accepted_surrogate_pair.json" ); }
test { try expectPass( "y_string_accepted_surrogate_pairs.json" ); }
test { try expectPass( "y_string_allowed_escapes.json" ); }
test { try expectPass( "y_string_backslash_and_u_escaped_zero.json" ); }
test { try expectPass( "y_string_backslash_doublequotes.json" ); }
test { try expectPass( "y_string_comments.json" ); }
test { try expectPass( "y_string_double_escape_a.json" ); }
test { try expectPass( "y_string_double_escape_n.json" ); }
test { try expectPass( "y_string_escaped_control_character.json" ); }
test { try expectPass( "y_string_escaped_noncharacter.json" ); }
test { try expectPass( "y_string_in_array.json" ); }
test { try expectPass( "y_string_in_array_with_leading_space.json" ); }
test { try expectPass( "y_string_last_surrogates_1_and_2.json" ); }
test { try expectPass( "y_string_nbsp_uescaped.json" ); }
test { try expectPass( "y_string_nonCharacterInUTF-8_U+10FFFF.json" ); }
test { try expectPass( "y_string_nonCharacterInUTF-8_U+FFFF.json" ); }
test { try expectPass( "y_string_null_escape.json" ); }
test { try expectPass( "y_string_one-byte-utf-8.json" ); }
test { try expectPass( "y_string_pi.json" ); }
test { try expectPass( "y_string_reservedCharacterInUTF-8_U+1BFFF.json" ); }
test { try expectPass( "y_string_simple_ascii.json" ); }
test { try expectPass( "y_string_space.json" ); }
test { try expectPass( "y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json" ); }
test { try expectPass( "y_string_three-byte-utf-8.json" ); }
test { try expectPass( "y_string_two-byte-utf-8.json" ); }
test { try expectPass( "y_string_u+2028_line_sep.json" ); }
test { try expectPass( "y_string_u+2029_par_sep.json" ); }
test { try expectPass( "y_string_uEscape.json" ); }
test { try expectPass( "y_string_uescaped_newline.json" ); }
test { try expectPass( "y_string_unescaped_char_delete.json" ); }
test { try expectPass( "y_string_unicode.json" ); }
test { try expectPass( "y_string_unicodeEscapedBackslash.json" ); }
test { try expectPass( "y_string_unicode_2.json" ); }
test { try expectPass( "y_string_unicode_U+10FFFE_nonchar.json" ); }
test { try expectPass( "y_string_unicode_U+1FFFE_nonchar.json" ); }
test { try expectPass( "y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json" ); }
test { try expectPass( "y_string_unicode_U+2064_invisible_plus.json" ); }
test { try expectPass( "y_string_unicode_U+FDD0_nonchar.json" ); }
test { try expectPass( "y_string_unicode_U+FFFE_nonchar.json" ); }
test { try expectPass( "y_string_unicode_escaped_double_quote.json" ); }
test { try expectPass( "y_string_utf8.json" ); }
test { try expectPass( "y_string_with_del_character.json" ); }
test { try expectPass( "y_structure_lonely_false.json" ); }
test { try expectPass( "y_structure_lonely_int.json" ); }
test { try expectPass( "y_structure_lonely_negative_real.json" ); }
test { try expectPass( "y_structure_lonely_null.json" ); }
test { try expectPass( "y_structure_lonely_string.json" ); }
test { try expectPass( "y_structure_lonely_true.json" ); }
test { try expectPass( "y_structure_string_empty.json" ); }
test { try expectPass( "y_structure_trailing_newline.json" ); }
test { try expectPass( "y_structure_true_in_array.json" ); }
test { try expectPass( "y_structure_whitespace_array.json" ); }
