From 98cd3782087d198425cfa19906f43d53b8106837 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Thu, 26 Oct 2023 02:11:54 -0400 Subject: x86_64: fix behavior of `getValue` Old behavior renamed to `getValueIfFree`. --- lib/std/json/JSONTestSuite_test.zig | 6 ------ lib/std/json/dynamic_test.zig | 13 ------------- lib/std/json/hashmap_test.zig | 13 ------------- lib/std/json/static_test.zig | 3 +-- lib/std/json/stringify_test.zig | 3 --- lib/std/json/test.zig | 2 -- 6 files changed, 1 insertion(+), 39 deletions(-) (limited to 'lib/std/json') diff --git a/lib/std/json/JSONTestSuite_test.zig b/lib/std/json/JSONTestSuite_test.zig index 5d75e72159..30c5907f8b 100644 --- a/lib/std/json/JSONTestSuite_test.zig +++ b/lib/std/json/JSONTestSuite_test.zig @@ -764,8 +764,6 @@ test "y_number_simple_real.json" { try ok("[123.456789]"); } test "y_object.json" { - if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; - try ok("{\"asd\":\"sdf\", \"dfg\":\"fgh\"}"); } test "y_object_basic.json" { @@ -787,13 +785,9 @@ test "y_object_escaped_null_in_key.json" { try ok("{\"foo\\u0000bar\": 42}"); } test "y_object_extreme_numbers.json" { - if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; - try ok("{ \"min\": -1.0e+28, \"max\": 1.0e+28 }"); } test "y_object_long_strings.json" { - if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; - try ok("{\"x\":[{\"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}], \"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}"); } test "y_object_simple.json" { diff --git a/lib/std/json/dynamic_test.zig b/lib/std/json/dynamic_test.zig index c3500b6826..ad737502ed 100644 --- a/lib/std/json/dynamic_test.zig +++ b/lib/std/json/dynamic_test.zig @@ -1,5 +1,4 @@ const std = @import("std"); -const builtin = @import("builtin"); const mem = std.mem; const testing = std.testing; const ArenaAllocator = std.heap.ArenaAllocator; @@ -19,8 +18,6 @@ const jsonReader = @import("scanner.zig").reader; const JsonReader = @import("scanner.zig").Reader; test "json.parser.dynamic" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - const s = \\{ \\ "Image": { @@ -75,8 +72,6 @@ test "json.parser.dynamic" { const writeStream = @import("./stringify.zig").writeStream; test "write json then parse it" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - var out_buffer: [1000]u8 = undefined; var fixed_buffer_stream = std.io.fixedBufferStream(&out_buffer); @@ -143,8 +138,6 @@ test "Value.array allocator should still be usable after parsing" { } test "integer after float has proper type" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena_allocator.deinit(); const parsed = try testParse(arena_allocator.allocator(), @@ -157,8 +150,6 @@ test "integer after float has proper type" { } test "escaped characters" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena_allocator.deinit(); const input = @@ -238,8 +229,6 @@ test "Value.jsonStringify" { } test "parseFromValue(std.json.Value,...)" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - const str = \\{ \\ "int": 32, @@ -328,8 +317,6 @@ test "ParseOptions.max_value_len" { } test "many object keys" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - const doc = \\{ \\ "k1": "v1", diff --git a/lib/std/json/hashmap_test.zig b/lib/std/json/hashmap_test.zig index 1f71d91f7b..49d8caffae 100644 --- a/lib/std/json/hashmap_test.zig +++ b/lib/std/json/hashmap_test.zig @@ -1,5 +1,4 @@ const std = @import("std"); -const builtin = @import("builtin"); const testing = std.testing; const ArrayHashMap = @import("hashmap.zig").ArrayHashMap; @@ -19,8 +18,6 @@ const T = struct { }; test "parse json hashmap" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - const doc = \\{ \\ "abc": {"i": 0, "s": "d"}, @@ -36,8 +33,6 @@ test "parse json hashmap" { } test "parse json hashmap while streaming" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - const doc = \\{ \\ "abc": {"i": 0, "s": "d"}, @@ -63,8 +58,6 @@ test "parse json hashmap while streaming" { } test "parse json hashmap duplicate fields" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - var arena = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena.deinit(); @@ -93,8 +86,6 @@ test "parse json hashmap duplicate fields" { } test "stringify json hashmap" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - var value = ArrayHashMap(T){}; defer value.deinit(testing.allocator); { @@ -132,8 +123,6 @@ test "stringify json hashmap" { } test "stringify json hashmap whitespace" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - var value = ArrayHashMap(T){}; defer value.deinit(testing.allocator); try value.map.put(testing.allocator, "abc", .{ .i = 0, .s = "d" }); @@ -158,8 +147,6 @@ test "stringify json hashmap whitespace" { } test "json parse from value hashmap" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - const doc = \\{ \\ "abc": {"i": 0, "s": "d"}, diff --git a/lib/std/json/static_test.zig b/lib/std/json/static_test.zig index e447000674..0e071eefe3 100644 --- a/lib/std/json/static_test.zig +++ b/lib/std/json/static_test.zig @@ -1,5 +1,4 @@ const std = @import("std"); -const builtin = @import("builtin"); const testing = std.testing; const ArenaAllocator = std.heap.ArenaAllocator; const Allocator = std.mem.Allocator; @@ -786,7 +785,7 @@ test "max_value_len" { } test "parse into vector" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; + if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; const T = struct { vec_i32: @Vector(4, i32), diff --git a/lib/std/json/stringify_test.zig b/lib/std/json/stringify_test.zig index 6c27d392fe..9baeae9389 100644 --- a/lib/std/json/stringify_test.zig +++ b/lib/std/json/stringify_test.zig @@ -1,5 +1,4 @@ const std = @import("std"); -const builtin = @import("builtin"); const mem = std.mem; const testing = std.testing; @@ -16,8 +15,6 @@ const writeStreamMaxDepth = @import("stringify.zig").writeStreamMaxDepth; const writeStreamArbitraryDepth = @import("stringify.zig").writeStreamArbitraryDepth; test "json write stream" { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - var out_buf: [1024]u8 = undefined; var slice_stream = std.io.fixedBufferStream(&out_buf); const out = slice_stream.writer(); diff --git a/lib/std/json/test.zig b/lib/std/json/test.zig index 51c54a14aa..9530ab37a6 100644 --- a/lib/std/json/test.zig +++ b/lib/std/json/test.zig @@ -34,8 +34,6 @@ fn testHighLevelDynamicParser(s: []const u8) !void { // Additional tests not part of test JSONTestSuite. test "y_trailing_comma_after_empty" { - if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; - try roundTrip( \\{"1":[],"2":{},"3":"4"} ); -- cgit v1.2.3