| author | |
| committer | |
| log | 32e85d44eb72122d174de02d4020f149026dd787 |
| tree | c1cdf78a31337b74fce4a70d99d9eb1384651937 |
| parent | 2e6e39a7004dae626ad3088cbf1e652f157e6db8 |
56 files changed, 447 insertions(+), 17 deletions(-)
lib/std/Thread/Condition.zig+6| ... | ... | @@ -369,6 +369,8 @@ test "Condition - signal" { |
| 369 | 369 | return error.SkipZigTest; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 373 | ||
| 372 | 374 | const num_threads = 4; |
| 373 | 375 | |
| 374 | 376 | const SignalTest = struct { |
| ... | ... | @@ -498,6 +500,8 @@ test "Condition - broadcasting" { |
| 498 | 500 | return error.SkipZigTest; |
| 499 | 501 | } |
| 500 | 502 | |
| 503 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 504 | ||
| 501 | 505 | const num_threads = 10; |
| 502 | 506 | |
| 503 | 507 | const BroadcastTest = struct { |
| ... | ... | @@ -565,6 +569,8 @@ test "Condition - broadcasting - wake all threads" { |
| 565 | 569 | return error.SkipZigTest; |
| 566 | 570 | } |
| 567 | 571 | |
| 572 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 573 | ||
| 568 | 574 | var num_runs: usize = 1; |
| 569 | 575 | const num_threads = 10; |
| 570 | 576 |
lib/std/Thread/Mutex.zig+2| ... | ... | @@ -289,6 +289,8 @@ test "Mutex - many contended" { |
| 289 | 289 | return error.SkipZigTest; |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 293 | ||
| 292 | 294 | const num_threads = 4; |
| 293 | 295 | const num_increments = 1000; |
| 294 | 296 |
lib/std/Thread/RwLock.zig+2| ... | ... | @@ -297,6 +297,8 @@ test "RwLock - concurrent access" { |
| 297 | 297 | if (builtin.single_threaded) |
| 298 | 298 | return; |
| 299 | 299 | |
| 300 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 301 | ||
| 300 | 302 | const num_writers: usize = 2; |
| 301 | 303 | const num_readers: usize = 4; |
| 302 | 304 | const num_writes: usize = 10000; |
lib/std/Uri.zig+2| ... | ... | @@ -685,6 +685,8 @@ test "Special test" { |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | test "URI escaping" { |
| 688 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 689 | ||
| 688 | 690 | const input = "\\ö/ äöß ~~.adas-https://canvas:123/#ads&&sad"; |
| 689 | 691 | const expected = "%5C%C3%B6%2F%20%C3%A4%C3%B6%C3%9F%20~~.adas-https%3A%2F%2Fcanvas%3A123%2F%23ads%26%26sad"; |
| 690 | 692 |
lib/std/array_hash_map.zig+15| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("std.zig"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const debug = std.debug; |
| 3 | 4 | const assert = debug.assert; |
| 4 | 5 | const testing = std.testing; |
| ... | ... | @@ -2137,6 +2138,8 @@ test "ensure capacity leak" { |
| 2137 | 2138 | } |
| 2138 | 2139 | |
| 2139 | 2140 | test "big map" { |
| 2141 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2142 | ||
| 2140 | 2143 | var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator); |
| 2141 | 2144 | defer map.deinit(); |
| 2142 | 2145 | |
| ... | ... | @@ -2190,6 +2193,8 @@ test "big map" { |
| 2190 | 2193 | } |
| 2191 | 2194 | |
| 2192 | 2195 | test "clone" { |
| 2196 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2197 | ||
| 2193 | 2198 | var original = AutoArrayHashMap(i32, i32).init(std.testing.allocator); |
| 2194 | 2199 | defer original.deinit(); |
| 2195 | 2200 | |
| ... | ... | @@ -2216,6 +2221,8 @@ test "clone" { |
| 2216 | 2221 | } |
| 2217 | 2222 | |
| 2218 | 2223 | test "shrink" { |
| 2224 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2225 | ||
| 2219 | 2226 | var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator); |
| 2220 | 2227 | defer map.deinit(); |
| 2221 | 2228 | |
| ... | ... | @@ -2256,6 +2263,8 @@ test "shrink" { |
| 2256 | 2263 | } |
| 2257 | 2264 | |
| 2258 | 2265 | test "pop" { |
| 2266 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2267 | ||
| 2259 | 2268 | var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator); |
| 2260 | 2269 | defer map.deinit(); |
| 2261 | 2270 | |
| ... | ... | @@ -2274,6 +2283,8 @@ test "pop" { |
| 2274 | 2283 | } |
| 2275 | 2284 | |
| 2276 | 2285 | test "popOrNull" { |
| 2286 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2287 | ||
| 2277 | 2288 | var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator); |
| 2278 | 2289 | defer map.deinit(); |
| 2279 | 2290 | |
| ... | ... | @@ -2294,6 +2305,8 @@ test "popOrNull" { |
| 2294 | 2305 | } |
| 2295 | 2306 | |
| 2296 | 2307 | test "reIndex" { |
| 2308 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2309 | ||
| 2297 | 2310 | var map = ArrayHashMap(i32, i32, AutoContext(i32), true).init(std.testing.allocator); |
| 2298 | 2311 | defer map.deinit(); |
| 2299 | 2312 | |
| ... | ... | @@ -2338,6 +2351,8 @@ test "auto store_hash" { |
| 2338 | 2351 | } |
| 2339 | 2352 | |
| 2340 | 2353 | test "sort" { |
| 2354 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2355 | ||
| 2341 | 2356 | var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator); |
| 2342 | 2357 | defer map.deinit(); |
| 2343 | 2358 |
lib/std/array_list.zig+11| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("std.zig"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const debug = std.debug; |
| 3 | 4 | const assert = debug.assert; |
| 4 | 5 | const testing = std.testing; |
| ... | ... | @@ -1183,6 +1184,8 @@ test "std.ArrayList/ArrayListUnmanaged.initCapacity" { |
| 1183 | 1184 | } |
| 1184 | 1185 | |
| 1185 | 1186 | test "std.ArrayList/ArrayListUnmanaged.clone" { |
| 1187 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1188 | ||
| 1186 | 1189 | const a = testing.allocator; |
| 1187 | 1190 | { |
| 1188 | 1191 | var array = ArrayList(i32).init(a); |
| ... | ... | @@ -1224,6 +1227,8 @@ test "std.ArrayList/ArrayListUnmanaged.clone" { |
| 1224 | 1227 | } |
| 1225 | 1228 | |
| 1226 | 1229 | test "std.ArrayList/ArrayListUnmanaged.basic" { |
| 1230 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1231 | ||
| 1227 | 1232 | const a = testing.allocator; |
| 1228 | 1233 | { |
| 1229 | 1234 | var list = ArrayList(i32).init(a); |
| ... | ... | @@ -1508,6 +1513,8 @@ test "std.ArrayList/ArrayListUnmanaged.insert" { |
| 1508 | 1513 | } |
| 1509 | 1514 | |
| 1510 | 1515 | test "std.ArrayList/ArrayListUnmanaged.insertSlice" { |
| 1516 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1517 | ||
| 1511 | 1518 | const a = testing.allocator; |
| 1512 | 1519 | { |
| 1513 | 1520 | var list = ArrayList(i32).init(a); |
| ... | ... | @@ -1554,6 +1561,8 @@ test "std.ArrayList/ArrayListUnmanaged.insertSlice" { |
| 1554 | 1561 | } |
| 1555 | 1562 | |
| 1556 | 1563 | test "std.ArrayList/ArrayListUnmanaged.replaceRange" { |
| 1564 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1565 | ||
| 1557 | 1566 | var arena = std.heap.ArenaAllocator.init(testing.allocator); |
| 1558 | 1567 | defer arena.deinit(); |
| 1559 | 1568 | const a = arena.allocator(); |
| ... | ... | @@ -1725,6 +1734,8 @@ test "shrink still sets length when resizing is disabled" { |
| 1725 | 1734 | } |
| 1726 | 1735 | |
| 1727 | 1736 | test "shrinkAndFree with a copy" { |
| 1737 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1738 | ||
| 1728 | 1739 | var failing_allocator = testing.FailingAllocator.init(testing.allocator, .{ .resize_fail_index = 0 }); |
| 1729 | 1740 | const a = failing_allocator.allocator(); |
| 1730 | 1741 |
lib/std/atomic/Atomic.zig+2| ... | ... | @@ -469,6 +469,8 @@ test "Atomic.fetchSub" { |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | test "Atomic.fetchMin" { |
| 472 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 473 | ||
| 472 | 474 | inline for (atomicIntTypes()) |Int| { |
| 473 | 475 | inline for (atomic_rmw_orderings) |ordering| { |
| 474 | 476 | var x = Atomic(Int).init(5); |
lib/std/atomic/queue.zig+2| ... | ... | @@ -175,6 +175,8 @@ const puts_per_thread = 500; |
| 175 | 175 | const put_thread_count = 3; |
| 176 | 176 | |
| 177 | 177 | test "std.atomic.Queue" { |
| 178 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 179 | ||
| 178 | 180 | var plenty_of_memory = try std.heap.page_allocator.alloc(u8, 300 * 1024); |
| 179 | 181 | defer std.heap.page_allocator.free(plenty_of_memory); |
| 180 | 182 |
lib/std/bit_set.zig+7-2| ... | ... | @@ -33,6 +33,7 @@ |
| 33 | 33 | const std = @import("std.zig"); |
| 34 | 34 | const assert = std.debug.assert; |
| 35 | 35 | const Allocator = std.mem.Allocator; |
| 36 | const builtin = @import("builtin"); | |
| 36 | 37 | |
| 37 | 38 | /// Returns the optimal static bit set type for the specified number |
| 38 | 39 | /// of elements: either `IntegerBitSet` or `ArrayBitSet`, |
| ... | ... | @@ -1636,7 +1637,7 @@ fn testStaticBitSet(comptime Set: type) !void { |
| 1636 | 1637 | } |
| 1637 | 1638 | |
| 1638 | 1639 | test "IntegerBitSet" { |
| 1639 | switch (@import("builtin").zig_backend) { | |
| 1640 | switch (builtin.zig_backend) { | |
| 1640 | 1641 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, |
| 1641 | 1642 | else => {}, |
| 1642 | 1643 | } |
| ... | ... | @@ -1652,7 +1653,7 @@ test "IntegerBitSet" { |
| 1652 | 1653 | } |
| 1653 | 1654 | |
| 1654 | 1655 | test "ArrayBitSet" { |
| 1655 | switch (@import("builtin").zig_backend) { | |
| 1656 | switch (builtin.zig_backend) { | |
| 1656 | 1657 | .stage2_x86_64 => return error.SkipZigTest, |
| 1657 | 1658 | else => {}, |
| 1658 | 1659 | } |
| ... | ... | @@ -1667,6 +1668,8 @@ test "ArrayBitSet" { |
| 1667 | 1668 | } |
| 1668 | 1669 | |
| 1669 | 1670 | test "DynamicBitSetUnmanaged" { |
| 1671 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1672 | ||
| 1670 | 1673 | const allocator = std.testing.allocator; |
| 1671 | 1674 | var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300); |
| 1672 | 1675 | try testing.expectEqual(@as(usize, 0), a.count()); |
| ... | ... | @@ -1720,6 +1723,8 @@ test "DynamicBitSetUnmanaged" { |
| 1720 | 1723 | } |
| 1721 | 1724 | |
| 1722 | 1725 | test "DynamicBitSet" { |
| 1726 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1727 | ||
| 1723 | 1728 | const allocator = std.testing.allocator; |
| 1724 | 1729 | var a = try DynamicBitSet.initEmpty(allocator, 300); |
| 1725 | 1730 | try testing.expectEqual(@as(usize, 0), a.count()); |
lib/std/compress/deflate/compressor.zig+2| ... | ... | @@ -1069,6 +1069,8 @@ var deflate_tests = [_]DeflateTest{ |
| 1069 | 1069 | }; |
| 1070 | 1070 | |
| 1071 | 1071 | test "deflate" { |
| 1072 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1073 | ||
| 1072 | 1074 | for (deflate_tests) |dt| { |
| 1073 | 1075 | var output = ArrayList(u8).init(testing.allocator); |
| 1074 | 1076 | defer output.deinit(); |
lib/std/compress/deflate/compressor_test.zig+18| ... | ... | @@ -154,6 +154,8 @@ fn testToFromWithLimit(input: []const u8, limit: [11]u32) !void { |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | test "deflate/inflate" { |
| 157 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 158 | ||
| 157 | 159 | var limits = [_]u32{0} ** 11; |
| 158 | 160 | |
| 159 | 161 | var test0 = [_]u8{}; |
| ... | ... | @@ -178,6 +180,8 @@ test "deflate/inflate" { |
| 178 | 180 | } |
| 179 | 181 | |
| 180 | 182 | test "very long sparse chunk" { |
| 183 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 184 | ||
| 181 | 185 | // A SparseReader returns a stream consisting of 0s ending with 65,536 (1<<16) 1s. |
| 182 | 186 | // This tests missing hash references in a very large input. |
| 183 | 187 | const SparseReader = struct { |
| ... | ... | @@ -239,6 +243,8 @@ test "very long sparse chunk" { |
| 239 | 243 | } |
| 240 | 244 | |
| 241 | 245 | test "compressor reset" { |
| 246 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 247 | ||
| 242 | 248 | for (std.enums.values(deflate.Compression)) |c| { |
| 243 | 249 | try testWriterReset(c, null); |
| 244 | 250 | try testWriterReset(c, "dict"); |
| ... | ... | @@ -289,6 +295,8 @@ fn testWriterReset(level: deflate.Compression, dict: ?[]const u8) !void { |
| 289 | 295 | } |
| 290 | 296 | |
| 291 | 297 | test "decompressor dictionary" { |
| 298 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 299 | ||
| 292 | 300 | const dict = "hello world"; // dictionary |
| 293 | 301 | const text = "hello again world"; |
| 294 | 302 | |
| ... | ... | @@ -329,6 +337,8 @@ test "decompressor dictionary" { |
| 329 | 337 | } |
| 330 | 338 | |
| 331 | 339 | test "compressor dictionary" { |
| 340 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 341 | ||
| 332 | 342 | const dict = "hello world"; |
| 333 | 343 | const text = "hello again world"; |
| 334 | 344 | |
| ... | ... | @@ -375,6 +385,8 @@ test "compressor dictionary" { |
| 375 | 385 | // Update the hash for best_speed only if d.index < d.maxInsertIndex |
| 376 | 386 | // See https://golang.org/issue/2508 |
| 377 | 387 | test "Go non-regression test for 2508" { |
| 388 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 389 | ||
| 378 | 390 | var comp = try compressor( |
| 379 | 391 | testing.allocator, |
| 380 | 392 | io.null_writer, |
| ... | ... | @@ -392,6 +404,8 @@ test "Go non-regression test for 2508" { |
| 392 | 404 | } |
| 393 | 405 | |
| 394 | 406 | test "deflate/inflate string" { |
| 407 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 408 | ||
| 395 | 409 | const StringTest = struct { |
| 396 | 410 | filename: []const u8, |
| 397 | 411 | limit: [11]u32, |
| ... | ... | @@ -439,6 +453,8 @@ test "deflate/inflate string" { |
| 439 | 453 | } |
| 440 | 454 | |
| 441 | 455 | test "inflate reset" { |
| 456 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 457 | ||
| 442 | 458 | const strings = [_][]const u8{ |
| 443 | 459 | "lorem ipsum izzle fo rizzle", |
| 444 | 460 | "the quick brown fox jumped over", |
| ... | ... | @@ -485,6 +501,8 @@ test "inflate reset" { |
| 485 | 501 | } |
| 486 | 502 | |
| 487 | 503 | test "inflate reset dictionary" { |
| 504 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 505 | ||
| 488 | 506 | const dict = "the lorem fox"; |
| 489 | 507 | const strings = [_][]const u8{ |
| 490 | 508 | "lorem ipsum izzle fo rizzle", |
lib/std/compress/deflate/deflate_fast.zig+2| ... | ... | @@ -649,6 +649,8 @@ test "best speed shift offsets" { |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | test "best speed reset" { |
| 652 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 653 | ||
| 652 | 654 | // test that encoding is consistent across a warparound of the table offset. |
| 653 | 655 | // See https://github.com/golang/go/issues/34121 |
| 654 | 656 | const fmt = std.fmt; |
lib/std/compress/deflate/deflate_fast_test.zig+5| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const expect = std.testing.expect; |
| 3 | 4 | const io = std.io; |
| 4 | 5 | const mem = std.mem; |
| ... | ... | @@ -11,6 +12,8 @@ const inflate = @import("decompressor.zig"); |
| 11 | 12 | const deflate_const = @import("deflate_const.zig"); |
| 12 | 13 | |
| 13 | 14 | test "best speed" { |
| 15 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 16 | ||
| 14 | 17 | // Tests that round-tripping through deflate and then inflate recovers the original input. |
| 15 | 18 | // The Write sizes are near the thresholds in the compressor.encSpeed method (0, 16, 128), as well |
| 16 | 19 | // as near `deflate_const.max_store_block_size` (65535). |
| ... | ... | @@ -93,6 +96,8 @@ test "best speed" { |
| 93 | 96 | } |
| 94 | 97 | |
| 95 | 98 | test "best speed max match offset" { |
| 99 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 100 | ||
| 96 | 101 | const abc = "abcdefgh"; |
| 97 | 102 | const xyz = "stuvwxyz"; |
| 98 | 103 | const input_margin = 16 - 1; |
lib/std/compress/deflate/huffman_bit_writer.zig+6| ... | ... | @@ -845,6 +845,8 @@ const testing = std.testing; |
| 845 | 845 | const ArrayList = std.ArrayList; |
| 846 | 846 | |
| 847 | 847 | test "writeBlockHuff" { |
| 848 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 849 | ||
| 848 | 850 | // Tests huffman encoding against reference files to detect possible regressions. |
| 849 | 851 | // If encoding/bit allocation changes you can regenerate these files |
| 850 | 852 | |
| ... | ... | @@ -1569,6 +1571,8 @@ const TestType = enum { |
| 1569 | 1571 | }; |
| 1570 | 1572 | |
| 1571 | 1573 | test "writeBlock" { |
| 1574 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1575 | ||
| 1572 | 1576 | // tests if the writeBlock encoding has changed. |
| 1573 | 1577 | |
| 1574 | 1578 | const ttype: TestType = .write_block; |
| ... | ... | @@ -1584,6 +1588,8 @@ test "writeBlock" { |
| 1584 | 1588 | } |
| 1585 | 1589 | |
| 1586 | 1590 | test "writeBlockDynamic" { |
| 1591 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1592 | ||
| 1587 | 1593 | // tests if the writeBlockDynamic encoding has changed. |
| 1588 | 1594 | |
| 1589 | 1595 | const ttype: TestType = .write_dyn_block; |
lib/std/compress/deflate/huffman_code.zig+2| ... | ... | @@ -360,6 +360,8 @@ fn byFreq(context: void, a: LiteralNode, b: LiteralNode) bool { |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | test "generate a Huffman code from an array of frequencies" { |
| 363 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 364 | ||
| 363 | 365 | var freqs: [19]u16 = [_]u16{ |
| 364 | 366 | 8, // 0 |
| 365 | 367 | 1, // 1 |
lib/std/compress/gzip.zig+2| ... | ... | @@ -174,6 +174,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void { |
| 174 | 174 | // https://tools.ietf.org/rfc/rfc1952.txt length=25037 bytes |
| 175 | 175 | // SHA256=164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67 |
| 176 | 176 | test "compressed data" { |
| 177 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 178 | ||
| 177 | 179 | try testReader( |
| 178 | 180 | @embedFile("testdata/rfc1952.txt.gz"), |
| 179 | 181 | @embedFile("testdata/rfc1952.txt"), |
lib/std/compress/lzma/vec2d.zig+2| ... | ... | @@ -50,6 +50,8 @@ const expectEqualSlices = std.testing.expectEqualSlices; |
| 50 | 50 | const expectError = std.testing.expectError; |
| 51 | 51 | |
| 52 | 52 | test "Vec2D.init" { |
| 53 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 54 | ||
| 53 | 55 | const allocator = testing.allocator; |
| 54 | 56 | var vec2d = try Vec2D(i32).init(allocator, 1, .{ 2, 3 }); |
| 55 | 57 | defer vec2d.deinit(allocator); |
lib/std/compress/xz/test.zig+2| ... | ... | @@ -19,6 +19,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void { |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | test "compressed data" { |
| 22 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 23 | ||
| 22 | 24 | try testReader(@embedFile("testdata/good-0-empty.xz"), ""); |
| 23 | 25 | |
| 24 | 26 | inline for ([_][]const u8{ |
lib/std/compress/zlib.zig+4| ... | ... | @@ -199,6 +199,8 @@ fn testDecompress(data: []const u8, expected: []const u8) !void { |
| 199 | 199 | // https://tools.ietf.org/rfc/rfc1951.txt length=36944 bytes |
| 200 | 200 | // SHA256=5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009 |
| 201 | 201 | test "compressed data" { |
| 202 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 203 | ||
| 202 | 204 | const rfc1951_txt = @embedFile("testdata/rfc1951.txt"); |
| 203 | 205 | |
| 204 | 206 | // Compressed with compression level = 0 |
| ... | ... | @@ -264,6 +266,8 @@ test "sanity checks" { |
| 264 | 266 | } |
| 265 | 267 | |
| 266 | 268 | test "compress data" { |
| 269 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 270 | ||
| 267 | 271 | const allocator = testing.allocator; |
| 268 | 272 | const rfc1951_txt = @embedFile("testdata/rfc1951.txt"); |
| 269 | 273 |
lib/std/compress/zstandard.zig+2| ... | ... | @@ -266,6 +266,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void { |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | test "zstandard decompression" { |
| 269 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 270 | ||
| 269 | 271 | const uncompressed = @embedFile("testdata/rfc8478.txt"); |
| 270 | 272 | const compressed3 = @embedFile("testdata/rfc8478.txt.zst.3"); |
| 271 | 273 | const compressed19 = @embedFile("testdata/rfc8478.txt.zst.19"); |
lib/std/crypto/poly1305.zig+2| ... | ... | @@ -196,6 +196,8 @@ pub const Poly1305 = struct { |
| 196 | 196 | }; |
| 197 | 197 | |
| 198 | 198 | test "poly1305 rfc7439 vector1" { |
| 199 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 200 | ||
| 199 | 201 | const expected_mac = "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9"; |
| 200 | 202 | |
| 201 | 203 | const msg = "Cryptographic Forum Research Group"; |
lib/std/crypto/scrypt.zig+4-1| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | // https://github.com/Tarsnap/scrypt |
| 4 | 4 | |
| 5 | 5 | const std = @import("std"); |
| 6 | const builtin = @import("builtin"); | |
| 6 | 7 | const crypto = std.crypto; |
| 7 | 8 | const fmt = std.fmt; |
| 8 | 9 | const io = std.io; |
| ... | ... | @@ -683,7 +684,7 @@ test "unix-scrypt" { |
| 683 | 684 | } |
| 684 | 685 | |
| 685 | 686 | test "crypt format" { |
| 686 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 687 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 687 | 688 | |
| 688 | 689 | const str = "$7$C6..../....SodiumChloride$kBGj9fHznVYFQMEn/qDCfrDevf9YDtcDdKvEqHJLV8D"; |
| 689 | 690 | const params = try crypt_format.deserialize(crypt_format.HashResult(32), str); |
| ... | ... | @@ -693,6 +694,8 @@ test "crypt format" { |
| 693 | 694 | } |
| 694 | 695 | |
| 695 | 696 | test "kdf fast" { |
| 697 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 698 | ||
| 696 | 699 | const TestVector = struct { |
| 697 | 700 | password: []const u8, |
| 698 | 701 | salt: []const u8, |
lib/std/debug.zig+2| ... | ... | @@ -2513,6 +2513,8 @@ pub fn dumpStackPointerAddr(prefix: []const u8) void { |
| 2513 | 2513 | } |
| 2514 | 2514 | |
| 2515 | 2515 | test "manage resources correctly" { |
| 2516 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2517 | ||
| 2516 | 2518 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 2517 | 2519 | |
| 2518 | 2520 | if (builtin.os.tag == .windows) { |
lib/std/dwarf/expressions.zig+2| ... | ... | @@ -1054,6 +1054,8 @@ fn isOpcodeRegisterLocation(opcode: u8) bool { |
| 1054 | 1054 | |
| 1055 | 1055 | const testing = std.testing; |
| 1056 | 1056 | test "DWARF expressions" { |
| 1057 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1058 | ||
| 1057 | 1059 | const allocator = std.testing.allocator; |
| 1058 | 1060 | |
| 1059 | 1061 | const options = ExpressionOptions{}; |
lib/std/fifo.zig+2| ... | ... | @@ -505,6 +505,8 @@ test "LinearFifo(u8, .Dynamic)" { |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | test "LinearFifo" { |
| 508 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 509 | ||
| 508 | 510 | inline for ([_]type{ u1, u8, u16, u64 }) |T| { |
| 509 | 511 | inline for ([_]LinearFifoBufferType{ LinearFifoBufferType{ .Static = 32 }, .Slice, .Dynamic }) |bt| { |
| 510 | 512 | const FifoType = LinearFifo(T, bt); |
lib/std/fmt.zig+16| ... | ... | @@ -2129,6 +2129,8 @@ test "int.small" { |
| 2129 | 2129 | } |
| 2130 | 2130 | |
| 2131 | 2131 | test "int.specifier" { |
| 2132 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2133 | ||
| 2132 | 2134 | { |
| 2133 | 2135 | const value: u8 = 'a'; |
| 2134 | 2136 | try expectFmt("u8: a\n", "u8: {c}\n", .{value}); |
| ... | ... | @@ -2179,6 +2181,8 @@ test "int.padded" { |
| 2179 | 2181 | } |
| 2180 | 2182 | |
| 2181 | 2183 | test "buffer" { |
| 2184 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2185 | ||
| 2182 | 2186 | { |
| 2183 | 2187 | var buf1: [32]u8 = undefined; |
| 2184 | 2188 | var fbs = std.io.fixedBufferStream(&buf1); |
| ... | ... | @@ -2375,6 +2379,8 @@ test "float.scientific" { |
| 2375 | 2379 | } |
| 2376 | 2380 | |
| 2377 | 2381 | test "float.scientific.precision" { |
| 2382 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2383 | ||
| 2378 | 2384 | try expectFmt("f64: 1.40971e-42", "f64: {e:.5}", .{@as(f64, 1.409706e-42)}); |
| 2379 | 2385 | try expectFmt("f64: 1.00000e-09", "f64: {e:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 814313563))))}); |
| 2380 | 2386 | try expectFmt("f64: 7.81250e-03", "f64: {e:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 1006632960))))}); |
| ... | ... | @@ -2435,6 +2441,8 @@ test "float.hexadecimal" { |
| 2435 | 2441 | } |
| 2436 | 2442 | |
| 2437 | 2443 | test "float.hexadecimal.precision" { |
| 2444 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2445 | ||
| 2438 | 2446 | try expectFmt("f16: 0x1.5p-2", "f16: {x:.1}", .{@as(f16, 1.0 / 3.0)}); |
| 2439 | 2447 | try expectFmt("f32: 0x1.555p-2", "f32: {x:.3}", .{@as(f32, 1.0 / 3.0)}); |
| 2440 | 2448 | try expectFmt("f64: 0x1.55555p-2", "f64: {x:.5}", .{@as(f64, 1.0 / 3.0)}); |
| ... | ... | @@ -2449,6 +2457,8 @@ test "float.hexadecimal.precision" { |
| 2449 | 2457 | } |
| 2450 | 2458 | |
| 2451 | 2459 | test "float.decimal" { |
| 2460 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2461 | ||
| 2452 | 2462 | try expectFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)}); |
| 2453 | 2463 | try expectFmt("f32: 0", "f32: {d}", .{@as(f32, 0.0)}); |
| 2454 | 2464 | try expectFmt("f32: 0", "f32: {d:.0}", .{@as(f32, 0.0)}); |
| ... | ... | @@ -2472,6 +2482,8 @@ test "float.decimal" { |
| 2472 | 2482 | } |
| 2473 | 2483 | |
| 2474 | 2484 | test "float.libc.sanity" { |
| 2485 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2486 | ||
| 2475 | 2487 | try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 916964781))))}); |
| 2476 | 2488 | try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 925353389))))}); |
| 2477 | 2489 | try expectFmt("f64: 0.10000", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 1036831278))))}); |
| ... | ... | @@ -2491,6 +2503,8 @@ test "float.libc.sanity" { |
| 2491 | 2503 | } |
| 2492 | 2504 | |
| 2493 | 2505 | test "custom" { |
| 2506 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2507 | ||
| 2494 | 2508 | const Vec2 = struct { |
| 2495 | 2509 | const SelfType = @This(); |
| 2496 | 2510 | x: f32, |
| ... | ... | @@ -2669,6 +2683,8 @@ test "formatFloatValue with comptime_float" { |
| 2669 | 2683 | } |
| 2670 | 2684 | |
| 2671 | 2685 | test "formatType max_depth" { |
| 2686 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2687 | ||
| 2672 | 2688 | const Vec2 = struct { |
| 2673 | 2689 | const SelfType = @This(); |
| 2674 | 2690 | x: f32, |
lib/std/hash/auto_hash.zig+21| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const assert = std.debug.assert; |
| 3 | const builtin = @import("builtin"); | |
| 3 | 4 | const mem = std.mem; |
| 4 | 5 | const meta = std.meta; |
| 5 | 6 | |
| ... | ... | @@ -252,6 +253,8 @@ test "typeContainsSlice" { |
| 252 | 253 | } |
| 253 | 254 | |
| 254 | 255 | test "hash pointer" { |
| 256 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 257 | ||
| 255 | 258 | const array = [_]u32{ 123, 123, 123 }; |
| 256 | 259 | const a = &array[0]; |
| 257 | 260 | const b = &array[1]; |
| ... | ... | @@ -272,6 +275,8 @@ test "hash pointer" { |
| 272 | 275 | } |
| 273 | 276 | |
| 274 | 277 | test "hash slice shallow" { |
| 278 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 279 | ||
| 275 | 280 | // Allocate one array dynamically so that we're assured it is not merged |
| 276 | 281 | // with the other by the optimization passes. |
| 277 | 282 | const array1 = try std.testing.allocator.create([6]u32); |
| ... | ... | @@ -290,6 +295,8 @@ test "hash slice shallow" { |
| 290 | 295 | } |
| 291 | 296 | |
| 292 | 297 | test "hash slice deep" { |
| 298 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 299 | ||
| 293 | 300 | // Allocate one array dynamically so that we're assured it is not merged |
| 294 | 301 | // with the other by the optimization passes. |
| 295 | 302 | const array1 = try std.testing.allocator.create([6]u32); |
| ... | ... | @@ -306,6 +313,8 @@ test "hash slice deep" { |
| 306 | 313 | } |
| 307 | 314 | |
| 308 | 315 | test "hash struct deep" { |
| 316 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 317 | ||
| 309 | 318 | const Foo = struct { |
| 310 | 319 | a: u32, |
| 311 | 320 | b: u16, |
| ... | ... | @@ -345,6 +354,8 @@ test "hash struct deep" { |
| 345 | 354 | } |
| 346 | 355 | |
| 347 | 356 | test "testHash optional" { |
| 357 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 358 | ||
| 348 | 359 | const a: ?u32 = 123; |
| 349 | 360 | const b: ?u32 = null; |
| 350 | 361 | try testing.expectEqual(testHash(a), testHash(@as(u32, 123))); |
| ... | ... | @@ -353,6 +364,8 @@ test "testHash optional" { |
| 353 | 364 | } |
| 354 | 365 | |
| 355 | 366 | test "testHash array" { |
| 367 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 368 | ||
| 356 | 369 | const a = [_]u32{ 1, 2, 3 }; |
| 357 | 370 | const h = testHash(a); |
| 358 | 371 | var hasher = Wyhash.init(0); |
| ... | ... | @@ -369,6 +382,8 @@ test "testHash multi-dimensional array" { |
| 369 | 382 | } |
| 370 | 383 | |
| 371 | 384 | test "testHash struct" { |
| 385 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 386 | ||
| 372 | 387 | const Foo = struct { |
| 373 | 388 | a: u32 = 1, |
| 374 | 389 | b: u32 = 2, |
| ... | ... | @@ -384,6 +399,8 @@ test "testHash struct" { |
| 384 | 399 | } |
| 385 | 400 | |
| 386 | 401 | test "testHash union" { |
| 402 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 403 | ||
| 387 | 404 | const Foo = union(enum) { |
| 388 | 405 | A: u32, |
| 389 | 406 | B: bool, |
| ... | ... | @@ -408,6 +425,8 @@ test "testHash union" { |
| 408 | 425 | } |
| 409 | 426 | |
| 410 | 427 | test "testHash vector" { |
| 428 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 429 | ||
| 411 | 430 | const a: @Vector(4, u32) = [_]u32{ 1, 2, 3, 4 }; |
| 412 | 431 | const b: @Vector(4, u32) = [_]u32{ 1, 2, 3, 5 }; |
| 413 | 432 | try testing.expect(testHash(a) == testHash(a)); |
| ... | ... | @@ -420,6 +439,8 @@ test "testHash vector" { |
| 420 | 439 | } |
| 421 | 440 | |
| 422 | 441 | test "testHash error union" { |
| 442 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 443 | ||
| 423 | 444 | const Errors = error{Test}; |
| 424 | 445 | const Foo = struct { |
| 425 | 446 | a: u32 = 1, |
lib/std/hash/wyhash.zig+2| ... | ... | @@ -242,6 +242,8 @@ test "smhasher" { |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | test "iterative api" { |
| 245 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 246 | ||
| 245 | 247 | const Test = struct { |
| 246 | 248 | fn do() !void { |
| 247 | 249 | try verify.iterativeApi(Wyhash); |
lib/std/hash_map.zig+2| ... | ... | @@ -1872,6 +1872,8 @@ test "std.hash_map multiple removes on same metadata" { |
| 1872 | 1872 | } |
| 1873 | 1873 | |
| 1874 | 1874 | test "std.hash_map put and remove loop in random order" { |
| 1875 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1876 | ||
| 1875 | 1877 | var map = AutoHashMap(u32, u32).init(std.testing.allocator); |
| 1876 | 1878 | defer map.deinit(); |
| 1877 | 1879 |
lib/std/heap/general_purpose_allocator.zig+4| ... | ... | @@ -1042,6 +1042,8 @@ const TraceKind = enum { |
| 1042 | 1042 | const test_config = Config{}; |
| 1043 | 1043 | |
| 1044 | 1044 | test "small allocations - free in same order" { |
| 1045 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1046 | ||
| 1045 | 1047 | var gpa = GeneralPurposeAllocator(test_config){}; |
| 1046 | 1048 | defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); |
| 1047 | 1049 | const allocator = gpa.allocator(); |
| ... | ... | @@ -1061,6 +1063,8 @@ test "small allocations - free in same order" { |
| 1061 | 1063 | } |
| 1062 | 1064 | |
| 1063 | 1065 | test "small allocations - free in reverse order" { |
| 1066 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1067 | ||
| 1064 | 1068 | var gpa = GeneralPurposeAllocator(test_config){}; |
| 1065 | 1069 | defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); |
| 1066 | 1070 | const allocator = gpa.allocator(); |
lib/std/io/bit_reader.zig+2| ... | ... | @@ -164,6 +164,8 @@ pub fn bitReader( |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | test "api coverage" { |
| 167 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 168 | ||
| 167 | 169 | const mem_be = [_]u8{ 0b11001101, 0b00001011 }; |
| 168 | 170 | const mem_le = [_]u8{ 0b00011101, 0b10010101 }; |
| 169 | 171 |
lib/std/json.zig+5-1| ... | ... | @@ -38,12 +38,16 @@ test parseFromSlice { |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | test Value { |
| 41 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 42 | ||
| 41 | 43 | var parsed = try parseFromSlice(Value, testing.allocator, "{\"anything\": \"goes\"}", .{}); |
| 42 | 44 | defer parsed.deinit(); |
| 43 | 45 | try testing.expectEqualSlices(u8, "goes", parsed.value.object.get("anything").?.string); |
| 44 | 46 | } |
| 45 | 47 | |
| 46 | 48 | test writeStream { |
| 49 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 50 | ||
| 47 | 51 | var out = ArrayList(u8).init(testing.allocator); |
| 48 | 52 | defer out.deinit(); |
| 49 | 53 | var write_stream = writeStream(out.writer(), .{ .whitespace = .indent_2 }); |
| ... | ... | @@ -61,7 +65,7 @@ test writeStream { |
| 61 | 65 | } |
| 62 | 66 | |
| 63 | 67 | test stringify { |
| 64 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 68 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 65 | 69 | |
| 66 | 70 | var out = ArrayList(u8).init(testing.allocator); |
| 67 | 71 | defer out.deinit(); |
lib/std/json/JSONTestSuite_test.zig+72| ... | ... | @@ -104,6 +104,8 @@ test "i_string_utf16LE_no_BOM.json" { |
| 104 | 104 | try any("[\x00\"\x00\xe9\x00\"\x00]\x00"); |
| 105 | 105 | } |
| 106 | 106 | test "i_structure_500_nested_arrays.json" { |
| 107 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 108 | ||
| 107 | 109 | try any("[" ** 500 ++ "]" ** 500); |
| 108 | 110 | } |
| 109 | 111 | test "i_structure_UTF-8_BOM_empty_object.json" { |
| ... | ... | @@ -359,15 +361,21 @@ test "n_object_bracket_key.json" { |
| 359 | 361 | try err("{[: \"x\"}\n"); |
| 360 | 362 | } |
| 361 | 363 | test "n_object_comma_instead_of_colon.json" { |
| 364 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 365 | ||
| 362 | 366 | try err("{\"x\", null}"); |
| 363 | 367 | } |
| 364 | 368 | test "n_object_double_colon.json" { |
| 369 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 370 | ||
| 365 | 371 | try err("{\"x\"::\"b\"}"); |
| 366 | 372 | } |
| 367 | 373 | test "n_object_emoji.json" { |
| 368 | 374 | try err("{\xf0\x9f\x87\xa8\xf0\x9f\x87\xad}"); |
| 369 | 375 | } |
| 370 | 376 | test "n_object_garbage_at_end.json" { |
| 377 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 378 | ||
| 371 | 379 | try err("{\"a\":\"a\" 123}"); |
| 372 | 380 | } |
| 373 | 381 | test "n_object_key_with_single_quotes.json" { |
| ... | ... | @@ -377,18 +385,26 @@ test "n_object_lone_continuation_byte_in_key_and_trailing_comma.json" { |
| 377 | 385 | try err("{\"\xb9\":\"0\",}"); |
| 378 | 386 | } |
| 379 | 387 | test "n_object_missing_colon.json" { |
| 388 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 389 | ||
| 380 | 390 | try err("{\"a\" b}"); |
| 381 | 391 | } |
| 382 | 392 | test "n_object_missing_key.json" { |
| 383 | 393 | try err("{:\"b\"}"); |
| 384 | 394 | } |
| 385 | 395 | test "n_object_missing_semicolon.json" { |
| 396 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 397 | ||
| 386 | 398 | try err("{\"a\" \"b\"}"); |
| 387 | 399 | } |
| 388 | 400 | test "n_object_missing_value.json" { |
| 401 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 402 | ||
| 389 | 403 | try err("{\"a\":"); |
| 390 | 404 | } |
| 391 | 405 | test "n_object_no-colon.json" { |
| 406 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 407 | ||
| 392 | 408 | try err("{\"a\""); |
| 393 | 409 | } |
| 394 | 410 | test "n_object_non_string_key.json" { |
| ... | ... | @@ -401,39 +417,59 @@ test "n_object_repeated_null_null.json" { |
| 401 | 417 | try err("{null:null,null:null}"); |
| 402 | 418 | } |
| 403 | 419 | test "n_object_several_trailing_commas.json" { |
| 420 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 421 | ||
| 404 | 422 | try err("{\"id\":0,,,,,}"); |
| 405 | 423 | } |
| 406 | 424 | test "n_object_single_quote.json" { |
| 407 | 425 | try err("{'a':0}"); |
| 408 | 426 | } |
| 409 | 427 | test "n_object_trailing_comma.json" { |
| 428 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 429 | ||
| 410 | 430 | try err("{\"id\":0,}"); |
| 411 | 431 | } |
| 412 | 432 | test "n_object_trailing_comment.json" { |
| 433 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 434 | ||
| 413 | 435 | try err("{\"a\":\"b\"}/**/"); |
| 414 | 436 | } |
| 415 | 437 | test "n_object_trailing_comment_open.json" { |
| 438 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 439 | ||
| 416 | 440 | try err("{\"a\":\"b\"}/**//"); |
| 417 | 441 | } |
| 418 | 442 | test "n_object_trailing_comment_slash_open.json" { |
| 443 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 444 | ||
| 419 | 445 | try err("{\"a\":\"b\"}//"); |
| 420 | 446 | } |
| 421 | 447 | test "n_object_trailing_comment_slash_open_incomplete.json" { |
| 448 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 449 | ||
| 422 | 450 | try err("{\"a\":\"b\"}/"); |
| 423 | 451 | } |
| 424 | 452 | test "n_object_two_commas_in_a_row.json" { |
| 453 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 454 | ||
| 425 | 455 | try err("{\"a\":\"b\",,\"c\":\"d\"}"); |
| 426 | 456 | } |
| 427 | 457 | test "n_object_unquoted_key.json" { |
| 428 | 458 | try err("{a: \"b\"}"); |
| 429 | 459 | } |
| 430 | 460 | test "n_object_unterminated-value.json" { |
| 461 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 462 | ||
| 431 | 463 | try err("{\"a\":\"a"); |
| 432 | 464 | } |
| 433 | 465 | test "n_object_with_single_string.json" { |
| 466 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 467 | ||
| 434 | 468 | try err("{ \"foo\" : \"bar\", \"a\" }"); |
| 435 | 469 | } |
| 436 | 470 | test "n_object_with_trailing_garbage.json" { |
| 471 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 472 | ||
| 437 | 473 | try err("{\"a\":\"b\"}#"); |
| 438 | 474 | } |
| 439 | 475 | test "n_single_space.json" { |
| ... | ... | @@ -560,6 +596,8 @@ test "n_structure_close_unopened_array.json" { |
| 560 | 596 | try err("1]"); |
| 561 | 597 | } |
| 562 | 598 | test "n_structure_comma_instead_of_closing_brace.json" { |
| 599 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 600 | ||
| 563 | 601 | try err("{\"x\": true,"); |
| 564 | 602 | } |
| 565 | 603 | test "n_structure_double_array.json" { |
| ... | ... | @@ -590,12 +628,18 @@ test "n_structure_object_followed_by_closing_object.json" { |
| 590 | 628 | try err("{}}"); |
| 591 | 629 | } |
| 592 | 630 | test "n_structure_object_unclosed_no_value.json" { |
| 631 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 632 | ||
| 593 | 633 | try err("{\"\":"); |
| 594 | 634 | } |
| 595 | 635 | test "n_structure_object_with_comment.json" { |
| 636 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 637 | ||
| 596 | 638 | try err("{\"a\":/*comment*/\"b\"}"); |
| 597 | 639 | } |
| 598 | 640 | test "n_structure_object_with_trailing_garbage.json" { |
| 641 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 642 | ||
| 599 | 643 | try err("{\"a\": true} \"x\""); |
| 600 | 644 | } |
| 601 | 645 | test "n_structure_open_array_apostrophe.json" { |
| ... | ... | @@ -605,6 +649,8 @@ test "n_structure_open_array_comma.json" { |
| 605 | 649 | try err("[,"); |
| 606 | 650 | } |
| 607 | 651 | test "n_structure_open_array_object.json" { |
| 652 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 653 | ||
| 608 | 654 | try err("[{\"\":" ** 50000 ++ "\n"); |
| 609 | 655 | } |
| 610 | 656 | test "n_structure_open_array_open_object.json" { |
| ... | ... | @@ -644,6 +690,8 @@ test "n_structure_single_star.json" { |
| 644 | 690 | try err("*"); |
| 645 | 691 | } |
| 646 | 692 | test "n_structure_trailing_#.json" { |
| 693 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 694 | ||
| 647 | 695 | try err("{\"a\":\"b\"}#{}"); |
| 648 | 696 | } |
| 649 | 697 | test "n_structure_uescaped_LF_before_string.json" { |
| ... | ... | @@ -662,6 +710,8 @@ test "n_structure_unclosed_array_unfinished_true.json" { |
| 662 | 710 | try err("[ false, tru"); |
| 663 | 711 | } |
| 664 | 712 | test "n_structure_unclosed_object.json" { |
| 713 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 714 | ||
| 665 | 715 | try err("{\"asd\":\"asd\""); |
| 666 | 716 | } |
| 667 | 717 | test "n_structure_unicode-identifier.json" { |
| ... | ... | @@ -764,39 +814,61 @@ test "y_number_simple_real.json" { |
| 764 | 814 | try ok("[123.456789]"); |
| 765 | 815 | } |
| 766 | 816 | test "y_object.json" { |
| 817 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 818 | ||
| 767 | 819 | try ok("{\"asd\":\"sdf\", \"dfg\":\"fgh\"}"); |
| 768 | 820 | } |
| 769 | 821 | test "y_object_basic.json" { |
| 822 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 823 | ||
| 770 | 824 | try ok("{\"asd\":\"sdf\"}"); |
| 771 | 825 | } |
| 772 | 826 | test "y_object_duplicated_key.json" { |
| 827 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 828 | ||
| 773 | 829 | try ok("{\"a\":\"b\",\"a\":\"c\"}"); |
| 774 | 830 | } |
| 775 | 831 | test "y_object_duplicated_key_and_value.json" { |
| 832 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 833 | ||
| 776 | 834 | try ok("{\"a\":\"b\",\"a\":\"b\"}"); |
| 777 | 835 | } |
| 778 | 836 | test "y_object_empty.json" { |
| 779 | 837 | try ok("{}"); |
| 780 | 838 | } |
| 781 | 839 | test "y_object_empty_key.json" { |
| 840 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 841 | ||
| 782 | 842 | try ok("{\"\":0}"); |
| 783 | 843 | } |
| 784 | 844 | test "y_object_escaped_null_in_key.json" { |
| 845 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 846 | ||
| 785 | 847 | try ok("{\"foo\\u0000bar\": 42}"); |
| 786 | 848 | } |
| 787 | 849 | test "y_object_extreme_numbers.json" { |
| 850 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 851 | ||
| 788 | 852 | try ok("{ \"min\": -1.0e+28, \"max\": 1.0e+28 }"); |
| 789 | 853 | } |
| 790 | 854 | test "y_object_long_strings.json" { |
| 855 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 856 | ||
| 791 | 857 | try ok("{\"x\":[{\"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}], \"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}"); |
| 792 | 858 | } |
| 793 | 859 | test "y_object_simple.json" { |
| 860 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 861 | ||
| 794 | 862 | try ok("{\"a\":[]}"); |
| 795 | 863 | } |
| 796 | 864 | test "y_object_string_unicode.json" { |
| 865 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 866 | ||
| 797 | 867 | try ok("{\"title\":\"\\u041f\\u043e\\u043b\\u0442\\u043e\\u0440\\u0430 \\u0417\\u0435\\u043c\\u043b\\u0435\\u043a\\u043e\\u043f\\u0430\" }"); |
| 798 | 868 | } |
| 799 | 869 | test "y_object_with_newlines.json" { |
| 870 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 871 | ||
| 800 | 872 | try ok("{\n\"a\": \"b\"\n}"); |
| 801 | 873 | } |
| 802 | 874 | test "y_string_1_2_3_bytes_UTF-8_sequences.json" { |
lib/std/json/test.zig+4-1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const testing = std.testing; |
| 3 | 4 | const parseFromSlice = @import("./static.zig").parseFromSlice; |
| 4 | 5 | const validate = @import("./scanner.zig").validate; |
| ... | ... | @@ -34,13 +35,15 @@ fn testHighLevelDynamicParser(s: []const u8) !void { |
| 34 | 35 | |
| 35 | 36 | // Additional tests not part of test JSONTestSuite. |
| 36 | 37 | test "y_trailing_comma_after_empty" { |
| 37 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 38 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 38 | 39 | |
| 39 | 40 | try roundTrip( |
| 40 | 41 | \\{"1":[],"2":{},"3":"4"} |
| 41 | 42 | ); |
| 42 | 43 | } |
| 43 | 44 | test "n_object_closed_missing_value" { |
| 45 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 46 | ||
| 44 | 47 | try err( |
| 45 | 48 | \\{"a":} |
| 46 | 49 | ); |
lib/std/leb128.zig+4| ... | ... | @@ -215,6 +215,8 @@ fn test_read_uleb128_seq(comptime T: type, comptime N: usize, encoded: []const u |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | test "deserialize signed LEB128" { |
| 218 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 219 | ||
| 218 | 220 | // Truncated |
| 219 | 221 | try testing.expectError(error.EndOfStream, test_read_stream_ileb128(i64, "\x80")); |
| 220 | 222 | |
| ... | ... | @@ -361,6 +363,8 @@ test "serialize unsigned LEB128" { |
| 361 | 363 | } |
| 362 | 364 | |
| 363 | 365 | test "serialize signed LEB128" { |
| 366 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 367 | ||
| 364 | 368 | // explicitly test i0 because starting `t` at 0 |
| 365 | 369 | // will break the while loop |
| 366 | 370 | try test_write_leb128(@as(i0, 0)); |
lib/std/math/big/int_test.zig+122-8| ... | ... | @@ -71,6 +71,8 @@ test "big.int set negative minimum" { |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | test "big.int set double-width maximum then zero" { |
| 74 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 75 | ||
| 74 | 76 | var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb)); |
| 75 | 77 | defer a.deinit(); |
| 76 | 78 | try a.set(@as(DoubleLimb, 0)); |
| ... | ... | @@ -244,6 +246,8 @@ test "big.int fits" { |
| 244 | 246 | } |
| 245 | 247 | |
| 246 | 248 | test "big.int string set" { |
| 249 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 250 | ||
| 247 | 251 | var a = try Managed.init(testing.allocator); |
| 248 | 252 | defer a.deinit(); |
| 249 | 253 | |
| ... | ... | @@ -260,6 +264,8 @@ test "big.int string negative" { |
| 260 | 264 | } |
| 261 | 265 | |
| 262 | 266 | test "big.int string set number with underscores" { |
| 267 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 268 | ||
| 263 | 269 | var a = try Managed.init(testing.allocator); |
| 264 | 270 | defer a.deinit(); |
| 265 | 271 | |
| ... | ... | @@ -268,6 +274,8 @@ test "big.int string set number with underscores" { |
| 268 | 274 | } |
| 269 | 275 | |
| 270 | 276 | test "big.int string set case insensitive number" { |
| 277 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 278 | ||
| 271 | 279 | var a = try Managed.init(testing.allocator); |
| 272 | 280 | defer a.deinit(); |
| 273 | 281 | |
| ... | ... | @@ -318,6 +326,8 @@ test "big.int twos complement limit set" { |
| 318 | 326 | } |
| 319 | 327 | |
| 320 | 328 | test "big.int string to" { |
| 329 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 330 | ||
| 321 | 331 | var a = try Managed.initSet(testing.allocator, 120317241209124781241290847124); |
| 322 | 332 | defer a.deinit(); |
| 323 | 333 | |
| ... | ... | @@ -358,6 +368,8 @@ test "big.int string to base 16" { |
| 358 | 368 | } |
| 359 | 369 | |
| 360 | 370 | test "big.int neg string to" { |
| 371 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 372 | ||
| 361 | 373 | var a = try Managed.initSet(testing.allocator, -123907434); |
| 362 | 374 | defer a.deinit(); |
| 363 | 375 | |
| ... | ... | @@ -380,6 +392,8 @@ test "big.int zero string to" { |
| 380 | 392 | } |
| 381 | 393 | |
| 382 | 394 | test "big.int clone" { |
| 395 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 396 | ||
| 383 | 397 | var a = try Managed.initSet(testing.allocator, 1234); |
| 384 | 398 | defer a.deinit(); |
| 385 | 399 | var b = try a.clone(); |
| ... | ... | @@ -517,6 +531,8 @@ test "big.int add multi-single" { |
| 517 | 531 | } |
| 518 | 532 | |
| 519 | 533 | test "big.int add multi-multi" { |
| 534 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 535 | ||
| 520 | 536 | var op1: u128 = 0xefefefef7f7f7f7f; |
| 521 | 537 | var op2: u128 = 0xfefefefe9f9f9f9f; |
| 522 | 538 | var a = try Managed.initSet(testing.allocator, op1); |
| ... | ... | @@ -618,6 +634,8 @@ test "big.int addWrap single-single, unsigned" { |
| 618 | 634 | } |
| 619 | 635 | |
| 620 | 636 | test "big.int subWrap single-single, unsigned" { |
| 637 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 638 | ||
| 621 | 639 | var a = try Managed.initSet(testing.allocator, 0); |
| 622 | 640 | defer a.deinit(); |
| 623 | 641 | |
| ... | ... | @@ -631,6 +649,8 @@ test "big.int subWrap single-single, unsigned" { |
| 631 | 649 | } |
| 632 | 650 | |
| 633 | 651 | test "big.int addWrap multi-multi, unsigned, limb aligned" { |
| 652 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 653 | ||
| 634 | 654 | var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb)); |
| 635 | 655 | defer a.deinit(); |
| 636 | 656 | |
| ... | ... | @@ -683,6 +703,8 @@ test "big.int subWrap single-single, signed" { |
| 683 | 703 | } |
| 684 | 704 | |
| 685 | 705 | test "big.int addWrap multi-multi, signed, limb aligned" { |
| 706 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 707 | ||
| 686 | 708 | var a = try Managed.initSet(testing.allocator, maxInt(SignedDoubleLimb)); |
| 687 | 709 | defer a.deinit(); |
| 688 | 710 | |
| ... | ... | @@ -733,6 +755,8 @@ test "big.int subSat single-single, unsigned" { |
| 733 | 755 | } |
| 734 | 756 | |
| 735 | 757 | test "big.int addSat multi-multi, unsigned, limb aligned" { |
| 758 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 759 | ||
| 736 | 760 | var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb)); |
| 737 | 761 | defer a.deinit(); |
| 738 | 762 | |
| ... | ... | @@ -818,6 +842,8 @@ test "big.int sub single-single" { |
| 818 | 842 | } |
| 819 | 843 | |
| 820 | 844 | test "big.int sub multi-single" { |
| 845 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 846 | ||
| 821 | 847 | var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1); |
| 822 | 848 | defer a.deinit(); |
| 823 | 849 | var b = try Managed.initSet(testing.allocator, 1); |
| ... | ... | @@ -831,6 +857,8 @@ test "big.int sub multi-single" { |
| 831 | 857 | } |
| 832 | 858 | |
| 833 | 859 | test "big.int sub multi-multi" { |
| 860 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 861 | ||
| 834 | 862 | var op1: u128 = 0xefefefefefefefefefefefef; |
| 835 | 863 | var op2: u128 = 0xabababababababababababab; |
| 836 | 864 | |
| ... | ... | @@ -935,6 +963,8 @@ test "big.int mul multi-multi" { |
| 935 | 963 | } |
| 936 | 964 | |
| 937 | 965 | test "big.int mul alias r with a" { |
| 966 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 967 | ||
| 938 | 968 | var a = try Managed.initSet(testing.allocator, maxInt(Limb)); |
| 939 | 969 | defer a.deinit(); |
| 940 | 970 | var b = try Managed.initSet(testing.allocator, 2); |
| ... | ... | @@ -946,6 +976,8 @@ test "big.int mul alias r with a" { |
| 946 | 976 | } |
| 947 | 977 | |
| 948 | 978 | test "big.int mul alias r with b" { |
| 979 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 980 | ||
| 949 | 981 | var a = try Managed.initSet(testing.allocator, maxInt(Limb)); |
| 950 | 982 | defer a.deinit(); |
| 951 | 983 | var b = try Managed.initSet(testing.allocator, 2); |
| ... | ... | @@ -957,6 +989,8 @@ test "big.int mul alias r with b" { |
| 957 | 989 | } |
| 958 | 990 | |
| 959 | 991 | test "big.int mul alias r with a and b" { |
| 992 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 993 | ||
| 960 | 994 | var a = try Managed.initSet(testing.allocator, maxInt(Limb)); |
| 961 | 995 | defer a.deinit(); |
| 962 | 996 | |
| ... | ... | @@ -992,6 +1026,8 @@ test "big.int mul 0*0" { |
| 992 | 1026 | } |
| 993 | 1027 | |
| 994 | 1028 | test "big.int mul large" { |
| 1029 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1030 | ||
| 995 | 1031 | var a = try Managed.initCapacity(testing.allocator, 50); |
| 996 | 1032 | defer a.deinit(); |
| 997 | 1033 | var b = try Managed.initCapacity(testing.allocator, 100); |
| ... | ... | @@ -1077,6 +1113,8 @@ test "big.int mulWrap multi-multi signed" { |
| 1077 | 1113 | } |
| 1078 | 1114 | |
| 1079 | 1115 | test "big.int mulWrap large" { |
| 1116 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1117 | ||
| 1080 | 1118 | var a = try Managed.initCapacity(testing.allocator, 50); |
| 1081 | 1119 | defer a.deinit(); |
| 1082 | 1120 | var b = try Managed.initCapacity(testing.allocator, 100); |
| ... | ... | @@ -1133,6 +1171,8 @@ test "big.int div single-half with rem" { |
| 1133 | 1171 | } |
| 1134 | 1172 | |
| 1135 | 1173 | test "big.int div single-single no rem" { |
| 1174 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1175 | ||
| 1136 | 1176 | // assumes usize is <= 64 bits. |
| 1137 | 1177 | var a = try Managed.initSet(testing.allocator, 1 << 52); |
| 1138 | 1178 | defer a.deinit(); |
| ... | ... | @@ -1150,6 +1190,8 @@ test "big.int div single-single no rem" { |
| 1150 | 1190 | } |
| 1151 | 1191 | |
| 1152 | 1192 | test "big.int div single-single with rem" { |
| 1193 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1194 | ||
| 1153 | 1195 | var a = try Managed.initSet(testing.allocator, (1 << 52) | (1 << 33)); |
| 1154 | 1196 | defer a.deinit(); |
| 1155 | 1197 | var b = try Managed.initSet(testing.allocator, (1 << 35)); |
| ... | ... | @@ -1166,6 +1208,8 @@ test "big.int div single-single with rem" { |
| 1166 | 1208 | } |
| 1167 | 1209 | |
| 1168 | 1210 | test "big.int div multi-single no rem" { |
| 1211 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1212 | ||
| 1169 | 1213 | var op1: u128 = 0xffffeeeeddddcccc; |
| 1170 | 1214 | var op2: u128 = 34; |
| 1171 | 1215 | |
| ... | ... | @@ -1185,6 +1229,8 @@ test "big.int div multi-single no rem" { |
| 1185 | 1229 | } |
| 1186 | 1230 | |
| 1187 | 1231 | test "big.int div multi-single with rem" { |
| 1232 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1233 | ||
| 1188 | 1234 | var op1: u128 = 0xffffeeeeddddcccf; |
| 1189 | 1235 | var op2: u128 = 34; |
| 1190 | 1236 | |
| ... | ... | @@ -1204,6 +1250,8 @@ test "big.int div multi-single with rem" { |
| 1204 | 1250 | } |
| 1205 | 1251 | |
| 1206 | 1252 | test "big.int div multi>2-single" { |
| 1253 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1254 | ||
| 1207 | 1255 | var op1: u128 = 0xfefefefefefefefefefefefefefefefe; |
| 1208 | 1256 | var op2: u128 = 0xefab8; |
| 1209 | 1257 | |
| ... | ... | @@ -1223,6 +1271,8 @@ test "big.int div multi>2-single" { |
| 1223 | 1271 | } |
| 1224 | 1272 | |
| 1225 | 1273 | test "big.int div single-single q < r" { |
| 1274 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1275 | ||
| 1226 | 1276 | var a = try Managed.initSet(testing.allocator, 0x0078f432); |
| 1227 | 1277 | defer a.deinit(); |
| 1228 | 1278 | var b = try Managed.initSet(testing.allocator, 0x01000000); |
| ... | ... | @@ -1267,7 +1317,10 @@ test "big.int div q=0 alias" { |
| 1267 | 1317 | } |
| 1268 | 1318 | |
| 1269 | 1319 | test "big.int div multi-multi q < r" { |
| 1270 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1320 | switch (builtin.zig_backend) { | |
| 1321 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 1322 | else => {}, | |
| 1323 | } | |
| 1271 | 1324 | |
| 1272 | 1325 | const op1 = 0x1ffffffff0078f432; |
| 1273 | 1326 | const op2 = 0x1ffffffff01000000; |
| ... | ... | @@ -1398,6 +1451,8 @@ test "big.int divTrunc #15535" { |
| 1398 | 1451 | } |
| 1399 | 1452 | |
| 1400 | 1453 | test "big.int divFloor #10932" { |
| 1454 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1455 | ||
| 1401 | 1456 | var a = try Managed.init(testing.allocator); |
| 1402 | 1457 | defer a.deinit(); |
| 1403 | 1458 | |
| ... | ... | @@ -1422,6 +1477,8 @@ test "big.int divFloor #10932" { |
| 1422 | 1477 | } |
| 1423 | 1478 | |
| 1424 | 1479 | test "big.int divFloor #11166" { |
| 1480 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1481 | ||
| 1425 | 1482 | var a = try Managed.init(testing.allocator); |
| 1426 | 1483 | defer a.deinit(); |
| 1427 | 1484 | |
| ... | ... | @@ -1585,6 +1642,8 @@ test "big.int div floor single-single -/-" { |
| 1585 | 1642 | } |
| 1586 | 1643 | |
| 1587 | 1644 | test "big.int div floor no remainder negative quotient" { |
| 1645 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1646 | ||
| 1588 | 1647 | const u: i32 = -0x80000000; |
| 1589 | 1648 | const v: i32 = 1; |
| 1590 | 1649 | |
| ... | ... | @@ -1642,7 +1701,10 @@ test "big.int div floor positive close to zero" { |
| 1642 | 1701 | } |
| 1643 | 1702 | |
| 1644 | 1703 | test "big.int div multi-multi with rem" { |
| 1645 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1704 | switch (builtin.zig_backend) { | |
| 1705 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 1706 | else => {}, | |
| 1707 | } | |
| 1646 | 1708 | |
| 1647 | 1709 | var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeeddddccccbbbbaaaa9999); |
| 1648 | 1710 | defer a.deinit(); |
| ... | ... | @@ -1660,7 +1722,10 @@ test "big.int div multi-multi with rem" { |
| 1660 | 1722 | } |
| 1661 | 1723 | |
| 1662 | 1724 | test "big.int div multi-multi no rem" { |
| 1663 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1725 | switch (builtin.zig_backend) { | |
| 1726 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 1727 | else => {}, | |
| 1728 | } | |
| 1664 | 1729 | |
| 1665 | 1730 | var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeedb4fec200ee3a4286361); |
| 1666 | 1731 | defer a.deinit(); |
| ... | ... | @@ -1678,7 +1743,10 @@ test "big.int div multi-multi no rem" { |
| 1678 | 1743 | } |
| 1679 | 1744 | |
| 1680 | 1745 | test "big.int div multi-multi (2 branch)" { |
| 1681 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1746 | switch (builtin.zig_backend) { | |
| 1747 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 1748 | else => {}, | |
| 1749 | } | |
| 1682 | 1750 | |
| 1683 | 1751 | var a = try Managed.initSet(testing.allocator, 0x866666665555555588888887777777761111111111111111); |
| 1684 | 1752 | defer a.deinit(); |
| ... | ... | @@ -1717,7 +1785,10 @@ test "big.int div multi-multi (3.1/3.3 branch)" { |
| 1717 | 1785 | } |
| 1718 | 1786 | |
| 1719 | 1787 | test "big.int div multi-single zero-limb trailing" { |
| 1720 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1788 | switch (builtin.zig_backend) { | |
| 1789 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 1790 | else => {}, | |
| 1791 | } | |
| 1721 | 1792 | |
| 1722 | 1793 | var a = try Managed.initSet(testing.allocator, 0x60000000000000000000000000000000000000000000000000000000000000000); |
| 1723 | 1794 | defer a.deinit(); |
| ... | ... | @@ -1737,7 +1808,10 @@ test "big.int div multi-single zero-limb trailing" { |
| 1737 | 1808 | } |
| 1738 | 1809 | |
| 1739 | 1810 | test "big.int div multi-multi zero-limb trailing (with rem)" { |
| 1740 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1811 | switch (builtin.zig_backend) { | |
| 1812 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 1813 | else => {}, | |
| 1814 | } | |
| 1741 | 1815 | |
| 1742 | 1816 | var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000); |
| 1743 | 1817 | defer a.deinit(); |
| ... | ... | @@ -1758,7 +1832,10 @@ test "big.int div multi-multi zero-limb trailing (with rem)" { |
| 1758 | 1832 | } |
| 1759 | 1833 | |
| 1760 | 1834 | test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-limb count > divisor zero-limb count" { |
| 1761 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1835 | switch (builtin.zig_backend) { | |
| 1836 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 1837 | else => {}, | |
| 1838 | } | |
| 1762 | 1839 | |
| 1763 | 1840 | var a = try Managed.initSet(testing.allocator, 0x8666666655555555888888877777777611111111111111110000000000000000); |
| 1764 | 1841 | defer a.deinit(); |
| ... | ... | @@ -1779,7 +1856,10 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li |
| 1779 | 1856 | } |
| 1780 | 1857 | |
| 1781 | 1858 | test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-limb count < divisor zero-limb count" { |
| 1782 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 1859 | switch (builtin.zig_backend) { | |
| 1860 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 1861 | else => {}, | |
| 1862 | } | |
| 1783 | 1863 | |
| 1784 | 1864 | var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000); |
| 1785 | 1865 | defer a.deinit(); |
| ... | ... | @@ -1802,6 +1882,8 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li |
| 1802 | 1882 | } |
| 1803 | 1883 | |
| 1804 | 1884 | test "big.int div multi-multi fuzz case #1" { |
| 1885 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1886 | ||
| 1805 | 1887 | var a = try Managed.init(testing.allocator); |
| 1806 | 1888 | defer a.deinit(); |
| 1807 | 1889 | var b = try Managed.init(testing.allocator); |
| ... | ... | @@ -1826,6 +1908,8 @@ test "big.int div multi-multi fuzz case #1" { |
| 1826 | 1908 | } |
| 1827 | 1909 | |
| 1828 | 1910 | test "big.int div multi-multi fuzz case #2" { |
| 1911 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1912 | ||
| 1829 | 1913 | var a = try Managed.init(testing.allocator); |
| 1830 | 1914 | defer a.deinit(); |
| 1831 | 1915 | var b = try Managed.init(testing.allocator); |
| ... | ... | @@ -1898,6 +1982,8 @@ test "big.int truncate multi to multi unsigned" { |
| 1898 | 1982 | } |
| 1899 | 1983 | |
| 1900 | 1984 | test "big.int truncate multi to multi signed" { |
| 1985 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1986 | ||
| 1901 | 1987 | var a = try Managed.initSet(testing.allocator, 3 << @bitSizeOf(Limb)); |
| 1902 | 1988 | defer a.deinit(); |
| 1903 | 1989 | |
| ... | ... | @@ -1907,6 +1993,8 @@ test "big.int truncate multi to multi signed" { |
| 1907 | 1993 | } |
| 1908 | 1994 | |
| 1909 | 1995 | test "big.int truncate negative multi to single" { |
| 1996 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1997 | ||
| 1910 | 1998 | var a = try Managed.initSet(testing.allocator, -@as(SignedDoubleLimb, maxInt(Limb) + 1)); |
| 1911 | 1999 | defer a.deinit(); |
| 1912 | 2000 | |
| ... | ... | @@ -2013,6 +2101,8 @@ test "big.int shift-right multi" { |
| 2013 | 2101 | } |
| 2014 | 2102 | |
| 2015 | 2103 | test "big.int shift-left single" { |
| 2104 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2105 | ||
| 2016 | 2106 | var a = try Managed.initSet(testing.allocator, 0xffff); |
| 2017 | 2107 | defer a.deinit(); |
| 2018 | 2108 | try a.shiftLeft(&a, 16); |
| ... | ... | @@ -2057,6 +2147,8 @@ test "big.int sat shift-left simple unsigned" { |
| 2057 | 2147 | } |
| 2058 | 2148 | |
| 2059 | 2149 | test "big.int sat shift-left simple unsigned no sat" { |
| 2150 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2151 | ||
| 2060 | 2152 | var a = try Managed.initSet(testing.allocator, 1); |
| 2061 | 2153 | defer a.deinit(); |
| 2062 | 2154 | try a.shiftLeftSat(&a, 16, .unsigned, 21); |
| ... | ... | @@ -2314,6 +2406,8 @@ test "big.int bitwise xor simple" { |
| 2314 | 2406 | } |
| 2315 | 2407 | |
| 2316 | 2408 | test "big.int bitwise xor multi-limb" { |
| 2409 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2410 | ||
| 2317 | 2411 | var x: DoubleLimb = maxInt(Limb) + 1; |
| 2318 | 2412 | var y: DoubleLimb = maxInt(Limb); |
| 2319 | 2413 | var a = try Managed.initSet(testing.allocator, x); |
| ... | ... | @@ -2578,6 +2672,8 @@ test "big.int mutable to managed" { |
| 2578 | 2672 | } |
| 2579 | 2673 | |
| 2580 | 2674 | test "big.int const to managed" { |
| 2675 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2676 | ||
| 2581 | 2677 | var a = try Managed.initSet(testing.allocator, 123423453456); |
| 2582 | 2678 | defer a.deinit(); |
| 2583 | 2679 | |
| ... | ... | @@ -2588,6 +2684,8 @@ test "big.int const to managed" { |
| 2588 | 2684 | } |
| 2589 | 2685 | |
| 2590 | 2686 | test "big.int pow" { |
| 2687 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2688 | ||
| 2591 | 2689 | { |
| 2592 | 2690 | var a = try Managed.initSet(testing.allocator, -3); |
| 2593 | 2691 | defer a.deinit(); |
| ... | ... | @@ -2643,6 +2741,8 @@ test "big.int pow" { |
| 2643 | 2741 | } |
| 2644 | 2742 | |
| 2645 | 2743 | test "big.int sqrt" { |
| 2744 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2745 | ||
| 2646 | 2746 | var r = try Managed.init(testing.allocator); |
| 2647 | 2747 | defer r.deinit(); |
| 2648 | 2748 | var a = try Managed.init(testing.allocator); |
| ... | ... | @@ -2673,6 +2773,8 @@ test "big.int sqrt" { |
| 2673 | 2773 | } |
| 2674 | 2774 | |
| 2675 | 2775 | test "big.int regression test for 1 limb overflow with alias" { |
| 2776 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2777 | ||
| 2676 | 2778 | // Note these happen to be two consecutive Fibonacci sequence numbers, the |
| 2677 | 2779 | // first two whose sum exceeds 2**64. |
| 2678 | 2780 | var a = try Managed.initSet(testing.allocator, 7540113804746346429); |
| ... | ... | @@ -2687,6 +2789,8 @@ test "big.int regression test for 1 limb overflow with alias" { |
| 2687 | 2789 | } |
| 2688 | 2790 | |
| 2689 | 2791 | test "big.int regression test for realloc with alias" { |
| 2792 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2793 | ||
| 2690 | 2794 | // Note these happen to be two consecutive Fibonacci sequence numbers, the |
| 2691 | 2795 | // second of which is the first such number to exceed 2**192. |
| 2692 | 2796 | var a = try Managed.initSet(testing.allocator, 5611500259351924431073312796924978741056961814867751431689); |
| ... | ... | @@ -2701,6 +2805,8 @@ test "big.int regression test for realloc with alias" { |
| 2701 | 2805 | } |
| 2702 | 2806 | |
| 2703 | 2807 | test "big int popcount" { |
| 2808 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2809 | ||
| 2704 | 2810 | var a = try Managed.init(testing.allocator); |
| 2705 | 2811 | defer a.deinit(); |
| 2706 | 2812 | |
| ... | ... | @@ -2781,6 +2887,8 @@ fn popCountTest(val: *const Managed, bit_count: usize, expected: usize) !void { |
| 2781 | 2887 | } |
| 2782 | 2888 | |
| 2783 | 2889 | test "big int conversion read/write twos complement" { |
| 2890 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2891 | ||
| 2784 | 2892 | var a = try Managed.initSet(testing.allocator, (1 << 493) - 1); |
| 2785 | 2893 | defer a.deinit(); |
| 2786 | 2894 | var b = try Managed.initSet(testing.allocator, (1 << 493) - 1); |
| ... | ... | @@ -2879,6 +2987,8 @@ test "big int write twos complement +/- zero" { |
| 2879 | 2987 | } |
| 2880 | 2988 | |
| 2881 | 2989 | test "big int conversion write twos complement with padding" { |
| 2990 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2991 | ||
| 2882 | 2992 | var a = try Managed.initSet(testing.allocator, 0x01_ffffffff_ffffffff_ffffffff); |
| 2883 | 2993 | defer a.deinit(); |
| 2884 | 2994 | |
| ... | ... | @@ -3108,6 +3218,8 @@ test "big int byte swap" { |
| 3108 | 3218 | } |
| 3109 | 3219 | |
| 3110 | 3220 | test "big.int mul multi-multi alias r with a and b" { |
| 3221 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 3222 | ||
| 3111 | 3223 | var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb)); |
| 3112 | 3224 | defer a.deinit(); |
| 3113 | 3225 | |
| ... | ... | @@ -3124,6 +3236,8 @@ test "big.int mul multi-multi alias r with a and b" { |
| 3124 | 3236 | } |
| 3125 | 3237 | |
| 3126 | 3238 | test "big.int sqr multi alias r with a" { |
| 3239 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 3240 | ||
| 3127 | 3241 | var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb)); |
| 3128 | 3242 | defer a.deinit(); |
| 3129 | 3243 |
lib/std/math/ilogb.zig+9| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | // https://git.musl-libc.org/cgit/musl/tree/src/math/ilogb.c |
| 7 | 7 | |
| 8 | 8 | const std = @import("../std.zig"); |
| 9 | const builtin = @import("builtin"); | |
| 9 | 10 | const math = std.math; |
| 10 | 11 | const expect = std.testing.expect; |
| 11 | 12 | const maxInt = std.math.maxInt; |
| ... | ... | @@ -108,6 +109,8 @@ test "64" { |
| 108 | 109 | } |
| 109 | 110 | |
| 110 | 111 | test "80" { |
| 112 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 113 | ||
| 111 | 114 | try expect(ilogbX(f80, 0.0) == fp_ilogb0); |
| 112 | 115 | try expect(ilogbX(f80, 0.5) == -1); |
| 113 | 116 | try expect(ilogbX(f80, 0.8923) == -1); |
| ... | ... | @@ -122,6 +125,8 @@ test "80" { |
| 122 | 125 | } |
| 123 | 126 | |
| 124 | 127 | test "128" { |
| 128 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 129 | ||
| 125 | 130 | try expect(ilogbX(f128, 0.0) == fp_ilogb0); |
| 126 | 131 | try expect(ilogbX(f128, 0.5) == -1); |
| 127 | 132 | try expect(ilogbX(f128, 0.8923) == -1); |
| ... | ... | @@ -157,6 +162,8 @@ test "64 special" { |
| 157 | 162 | } |
| 158 | 163 | |
| 159 | 164 | test "80 special" { |
| 165 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 166 | ||
| 160 | 167 | try expect(ilogbX(f80, math.inf(f80)) == maxInt(i32)); |
| 161 | 168 | try expect(ilogbX(f80, -math.inf(f80)) == maxInt(i32)); |
| 162 | 169 | try expect(ilogbX(f80, 0.0) == minInt(i32)); |
| ... | ... | @@ -164,6 +171,8 @@ test "80 special" { |
| 164 | 171 | } |
| 165 | 172 | |
| 166 | 173 | test "128 special" { |
| 174 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 175 | ||
| 167 | 176 | try expect(ilogbX(f128, math.inf(f128)) == maxInt(i32)); |
| 168 | 177 | try expect(ilogbX(f128, -math.inf(f128)) == maxInt(i32)); |
| 169 | 178 | try expect(ilogbX(f128, 0.0) == minInt(i32)); |
lib/std/math/ldexp.zig+1| ... | ... | @@ -67,6 +67,7 @@ pub fn ldexp(x: anytype, n: i32) @TypeOf(x) { |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | test "math.ldexp" { |
| 70 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 70 | 71 | |
| 71 | 72 | // subnormals |
| 72 | 73 | try expect(ldexp(@as(f16, 0x1.1FFp14), -14 - 9 - 15) == math.floatTrueMin(f16)); |
lib/std/math/log_int.zig+2| ... | ... | @@ -56,6 +56,8 @@ pub fn log_int(comptime T: type, base: T, x: T) Log2Int(T) { |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | test "math.log_int" { |
| 59 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 60 | ||
| 59 | 61 | // Test all unsigned integers with 2, 3, ..., 64 bits. |
| 60 | 62 | // We cannot test 0 or 1 bits since base must be > 1. |
| 61 | 63 | inline for (2..64 + 1) |bits| { |
lib/std/math/scalbn.zig+2| ... | ... | @@ -7,6 +7,8 @@ const expect = std.testing.expect; |
| 7 | 7 | pub const scalbn = @import("ldexp.zig").ldexp; |
| 8 | 8 | |
| 9 | 9 | test "math.scalbn" { |
| 10 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 11 | ||
| 10 | 12 | // Verify we are using base 2. |
| 11 | 13 | try expect(scalbn(@as(f16, 1.5), 4) == 24.0); |
| 12 | 14 | try expect(scalbn(@as(f32, 1.5), 4) == 24.0); |
lib/std/mem.zig+2| ... | ... | @@ -1025,6 +1025,8 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co |
| 1025 | 1025 | } |
| 1026 | 1026 | |
| 1027 | 1027 | test "indexOfSentinel vector paths" { |
| 1028 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1029 | ||
| 1028 | 1030 | const Types = [_]type{ u8, u16, u32, u64 }; |
| 1029 | 1031 | const allocator = std.testing.allocator; |
| 1030 | 1032 |
lib/std/net/test.zig+2| ... | ... | @@ -5,6 +5,7 @@ const mem = std.mem; |
| 5 | 5 | const testing = std.testing; |
| 6 | 6 | |
| 7 | 7 | test "parse and render IPv6 addresses" { |
| 8 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 8 | 9 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 9 | 10 | |
| 10 | 11 | var buffer: [100]u8 = undefined; |
| ... | ... | @@ -70,6 +71,7 @@ test "invalid but parseable IPv6 scope ids" { |
| 70 | 71 | } |
| 71 | 72 | |
| 72 | 73 | test "parse and render IPv4 addresses" { |
| 74 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 73 | 75 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 74 | 76 | |
| 75 | 77 | var buffer: [18]u8 = undefined; |
lib/std/once.zig+2| ... | ... | @@ -46,6 +46,8 @@ fn incr() void { |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | test "Once executes its function just once" { |
| 49 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 50 | ||
| 49 | 51 | if (builtin.single_threaded) { |
| 50 | 52 | global_once.call(); |
| 51 | 53 | global_once.call(); |
lib/std/os/linux/io_uring.zig+4| ... | ... | @@ -1862,6 +1862,8 @@ test "write/read" { |
| 1862 | 1862 | test "splice/read" { |
| 1863 | 1863 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 1864 | 1864 | |
| 1865 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1866 | ||
| 1865 | 1867 | var ring = IO_Uring.init(4, 0) catch |err| switch (err) { |
| 1866 | 1868 | error.SystemOutdated => return error.SkipZigTest, |
| 1867 | 1869 | error.PermissionDenied => return error.SkipZigTest, |
| ... | ... | @@ -2280,6 +2282,8 @@ test "timeout (after a number of completions)" { |
| 2280 | 2282 | test "timeout_remove" { |
| 2281 | 2283 | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 2282 | 2284 | |
| 2285 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2286 | ||
| 2283 | 2287 | var ring = IO_Uring.init(2, 0) catch |err| switch (err) { |
| 2284 | 2288 | error.SystemOutdated => return error.SkipZigTest, |
| 2285 | 2289 | error.PermissionDenied => return error.SkipZigTest, |
lib/std/os/test.zig+11| ... | ... | @@ -385,6 +385,8 @@ fn testThreadIdFn(thread_id: *Thread.Id) void { |
| 385 | 385 | test "std.Thread.getCurrentId" { |
| 386 | 386 | if (builtin.single_threaded) return error.SkipZigTest; |
| 387 | 387 | |
| 388 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 389 | ||
| 388 | 390 | var thread_current_id: Thread.Id = undefined; |
| 389 | 391 | const thread = try Thread.spawn(.{}, testThreadIdFn, .{&thread_current_id}); |
| 390 | 392 | thread.join(); |
| ... | ... | @@ -427,6 +429,9 @@ test "cpu count" { |
| 427 | 429 | |
| 428 | 430 | test "thread local storage" { |
| 429 | 431 | if (builtin.single_threaded) return error.SkipZigTest; |
| 432 | ||
| 433 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 434 | ||
| 430 | 435 | const thread1 = try Thread.spawn(.{}, testTls, .{}); |
| 431 | 436 | const thread2 = try Thread.spawn(.{}, testTls, .{}); |
| 432 | 437 | try testTls(); |
| ... | ... | @@ -514,6 +519,8 @@ fn iter_fn(info: *dl_phdr_info, size: usize, counter: *usize) IterFnError!void { |
| 514 | 519 | test "dl_iterate_phdr" { |
| 515 | 520 | if (builtin.object_format != .elf) return error.SkipZigTest; |
| 516 | 521 | |
| 522 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 523 | ||
| 517 | 524 | var counter: usize = 0; |
| 518 | 525 | try os.dl_iterate_phdr(&counter, IterFnError, iter_fn); |
| 519 | 526 | try expect(counter != 0); |
| ... | ... | @@ -773,6 +780,8 @@ test "getrlimit and setrlimit" { |
| 773 | 780 | return error.SkipZigTest; |
| 774 | 781 | } |
| 775 | 782 | |
| 783 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 784 | ||
| 776 | 785 | inline for (std.meta.fields(os.rlimit_resource)) |field| { |
| 777 | 786 | const resource = @as(os.rlimit_resource, @enumFromInt(field.value)); |
| 778 | 787 | const limit = try os.getrlimit(resource); |
| ... | ... | @@ -815,6 +824,8 @@ test "sigaction" { |
| 815 | 824 | if (native_os == .wasi or native_os == .windows) |
| 816 | 825 | return error.SkipZigTest; |
| 817 | 826 | |
| 827 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 828 | ||
| 818 | 829 | // https://github.com/ziglang/zig/issues/7427 |
| 819 | 830 | if (native_os == .linux and builtin.target.cpu.arch == .x86) |
| 820 | 831 | return error.SkipZigTest; |
lib/std/os/windows.zig+2| ... | ... | @@ -2491,6 +2491,8 @@ pub fn ntToWin32Namespace(path: []const u16) !PathSpace { |
| 2491 | 2491 | } |
| 2492 | 2492 | |
| 2493 | 2493 | test "ntToWin32Namespace" { |
| 2494 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 2495 | ||
| 2494 | 2496 | const L = std.unicode.utf8ToUtf16LeStringLiteral; |
| 2495 | 2497 | |
| 2496 | 2498 | try testNtToWin32Namespace(L("UNC"), L("\\??\\UNC")); |
lib/std/priority_dequeue.zig+2| ... | ... | @@ -705,6 +705,8 @@ test "std.PriorityDequeue: fromOwnedSlice trivial case 1" { |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | test "std.PriorityDequeue: fromOwnedSlice" { |
| 708 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 709 | ||
| 708 | 710 | const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; |
| 709 | 711 | const queue_items = try testing.allocator.dupe(u32, items[0..]); |
| 710 | 712 | var queue = PDQ.fromOwnedSlice(testing.allocator, queue_items[0..], {}); |
lib/std/priority_queue.zig+2| ... | ... | @@ -385,6 +385,8 @@ test "std.PriorityQueue: fromOwnedSlice trivial case 1" { |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | test "std.PriorityQueue: fromOwnedSlice" { |
| 388 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 389 | ||
| 388 | 390 | const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 }; |
| 389 | 391 | const heap_items = try testing.allocator.dupe(u32, items[0..]); |
| 390 | 392 | var queue = PQlt.fromOwnedSlice(testing.allocator, heap_items[0..], {}); |
lib/std/rand/test.zig+10-1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const math = std.math; |
| 3 | 4 | const DefaultPrng = std.rand.DefaultPrng; |
| 4 | 5 | const Random = std.rand.Random; |
| ... | ... | @@ -157,6 +158,8 @@ fn testRandomEnumValue() !void { |
| 157 | 158 | } |
| 158 | 159 | |
| 159 | 160 | test "Random intLessThan" { |
| 161 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 162 | ||
| 160 | 163 | @setEvalBranchQuota(10000); |
| 161 | 164 | try testRandomIntLessThan(); |
| 162 | 165 | try comptime testRandomIntLessThan(); |
| ... | ... | @@ -199,6 +202,8 @@ fn testRandomIntLessThan() !void { |
| 199 | 202 | } |
| 200 | 203 | |
| 201 | 204 | test "Random intAtMost" { |
| 205 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 206 | ||
| 202 | 207 | @setEvalBranchQuota(10000); |
| 203 | 208 | try testRandomIntAtMost(); |
| 204 | 209 | try comptime testRandomIntAtMost(); |
| ... | ... | @@ -239,6 +244,8 @@ fn testRandomIntAtMost() !void { |
| 239 | 244 | } |
| 240 | 245 | |
| 241 | 246 | test "Random Biased" { |
| 247 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 248 | ||
| 242 | 249 | var prng = DefaultPrng.init(0); |
| 243 | 250 | const random = prng.random(); |
| 244 | 251 | // Not thoroughly checking the logic here. |
| ... | ... | @@ -436,7 +443,7 @@ fn testRangeBias(r: Random, start: i8, end: i8, biased: bool) !void { |
| 436 | 443 | } |
| 437 | 444 | |
| 438 | 445 | test "CSPRNG" { |
| 439 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 446 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 440 | 447 | |
| 441 | 448 | var secret_seed: [DefaultCsprng.secret_seed_length]u8 = undefined; |
| 442 | 449 | std.crypto.random.bytes(&secret_seed); |
| ... | ... | @@ -449,6 +456,8 @@ test "CSPRNG" { |
| 449 | 456 | } |
| 450 | 457 | |
| 451 | 458 | test "Random weightedIndex" { |
| 459 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 460 | ||
| 452 | 461 | // Make sure weightedIndex works for various integers and floats |
| 453 | 462 | inline for (.{ u64, i4, f32, f64 }) |T| { |
| 454 | 463 | var prng = DefaultPrng.init(0); |
lib/std/segmented_list.zig+2| ... | ... | @@ -409,6 +409,8 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | test "SegmentedList basic usage" { |
| 412 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 413 | ||
| 412 | 414 | try testSegmentedList(0); |
| 413 | 415 | try testSegmentedList(1); |
| 414 | 416 | try testSegmentedList(2); |
lib/std/sort.zig+11| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("std.zig"); |
| 2 | 2 | const assert = std.debug.assert; |
| 3 | const builtin = @import("builtin"); | |
| 3 | 4 | const testing = std.testing; |
| 4 | 5 | const mem = std.mem; |
| 5 | 6 | const math = std.math; |
| ... | ... | @@ -176,6 +177,8 @@ const IdAndValue = struct { |
| 176 | 177 | }; |
| 177 | 178 | |
| 178 | 179 | test "stable sort" { |
| 180 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 181 | ||
| 179 | 182 | const expected = [_]IdAndValue{ |
| 180 | 183 | IdAndValue{ .id = 0, .value = 0 }, |
| 181 | 184 | IdAndValue{ .id = 1, .value = 0 }, |
| ... | ... | @@ -223,6 +226,8 @@ test "stable sort" { |
| 223 | 226 | } |
| 224 | 227 | |
| 225 | 228 | test "sort" { |
| 229 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 230 | ||
| 226 | 231 | const u8cases = [_][]const []const u8{ |
| 227 | 232 | &[_][]const u8{ |
| 228 | 233 | "", |
| ... | ... | @@ -301,6 +306,8 @@ test "sort" { |
| 301 | 306 | } |
| 302 | 307 | |
| 303 | 308 | test "sort descending" { |
| 309 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 310 | ||
| 304 | 311 | const rev_cases = [_][]const []const i32{ |
| 305 | 312 | &[_][]const i32{ |
| 306 | 313 | &[_]i32{}, |
| ... | ... | @@ -340,6 +347,8 @@ test "sort descending" { |
| 340 | 347 | } |
| 341 | 348 | |
| 342 | 349 | test "sort with context in the middle of a slice" { |
| 350 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 351 | ||
| 343 | 352 | const Context = struct { |
| 344 | 353 | items: []i32, |
| 345 | 354 | |
| ... | ... | @@ -379,6 +388,8 @@ test "sort with context in the middle of a slice" { |
| 379 | 388 | } |
| 380 | 389 | |
| 381 | 390 | test "sort fuzz testing" { |
| 391 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 392 | ||
| 382 | 393 | var prng = std.rand.DefaultPrng.init(0x12345678); |
| 383 | 394 | const random = prng.random(); |
| 384 | 395 | const test_case_count = 10; |
lib/std/treap.zig+2| ... | ... | @@ -350,6 +350,8 @@ const TestTreap = Treap(u64, std.math.order); |
| 350 | 350 | const TestNode = TestTreap.Node; |
| 351 | 351 | |
| 352 | 352 | test "std.Treap: insert, find, replace, remove" { |
| 353 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 354 | ||
| 353 | 355 | var treap = TestTreap{}; |
| 354 | 356 | var nodes: [10]TestNode = undefined; |
| 355 | 357 |
lib/std/zig/Parse.zig+2| ... | ... | @@ -4102,5 +4102,7 @@ const TokenIndex = Ast.TokenIndex; |
| 4102 | 4102 | const Token = std.zig.Token; |
| 4103 | 4103 | |
| 4104 | 4104 | test { |
| 4105 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 4106 | ||
| 4105 | 4107 | _ = @import("parser_test.zig"); |
| 4106 | 4108 | } |
lib/std/zig/fmt.zig+3| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const mem = std.mem; |
| 3 | 4 | |
| 4 | 5 | /// Print the string as a Zig identifier escaping it with @"" syntax if needed. |
| ... | ... | @@ -95,6 +96,8 @@ pub fn fmtEscapes(bytes: []const u8) std.fmt.Formatter(stringEscape) { |
| 95 | 96 | } |
| 96 | 97 | |
| 97 | 98 | test "escape invalid identifiers" { |
| 99 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 100 | ||
| 98 | 101 | const expectFmt = std.testing.expectFmt; |
| 99 | 102 | try expectFmt("@\"while\"", "{}", .{fmtId("while")}); |
| 100 | 103 | try expectFmt("hello", "{}", .{fmtId("hello")}); |
lib/std/zig/tokenizer.zig+10-1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | |
| 3 | 4 | pub const Token = struct { |
| 4 | 5 | tag: Tag, |
| ... | ... | @@ -1449,6 +1450,8 @@ test "chars" { |
| 1449 | 1450 | } |
| 1450 | 1451 | |
| 1451 | 1452 | test "invalid token characters" { |
| 1453 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1454 | ||
| 1452 | 1455 | try testTokenize("#", &.{.invalid}); |
| 1453 | 1456 | try testTokenize("`", &.{.invalid}); |
| 1454 | 1457 | try testTokenize("'c", &.{.invalid}); |
| ... | ... | @@ -1478,7 +1481,7 @@ test "utf8" { |
| 1478 | 1481 | } |
| 1479 | 1482 | |
| 1480 | 1483 | test "invalid utf8" { |
| 1481 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1484 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1482 | 1485 | |
| 1483 | 1486 | try testTokenize("//\x80", &.{ |
| 1484 | 1487 | .invalid, |
| ... | ... | @@ -1570,6 +1573,8 @@ test "pipe and then invalid" { |
| 1570 | 1573 | } |
| 1571 | 1574 | |
| 1572 | 1575 | test "line comment and doc comment" { |
| 1576 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1577 | ||
| 1573 | 1578 | try testTokenize("//", &.{}); |
| 1574 | 1579 | try testTokenize("// a / b", &.{}); |
| 1575 | 1580 | try testTokenize("// /", &.{}); |
| ... | ... | @@ -1644,6 +1649,8 @@ test "range literals" { |
| 1644 | 1649 | } |
| 1645 | 1650 | |
| 1646 | 1651 | test "number literals decimal" { |
| 1652 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1653 | ||
| 1647 | 1654 | try testTokenize("0", &.{.number_literal}); |
| 1648 | 1655 | try testTokenize("1", &.{.number_literal}); |
| 1649 | 1656 | try testTokenize("2", &.{.number_literal}); |
| ... | ... | @@ -1892,6 +1899,8 @@ test "invalid token with unfinished escape right before eof" { |
| 1892 | 1899 | } |
| 1893 | 1900 | |
| 1894 | 1901 | test "saturating operators" { |
| 1902 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1903 | ||
| 1895 | 1904 | try testTokenize("<<", &.{.angle_bracket_angle_bracket_left}); |
| 1896 | 1905 | try testTokenize("<<|", &.{.angle_bracket_angle_bracket_left_pipe}); |
| 1897 | 1906 | try testTokenize("<<|=", &.{.angle_bracket_angle_bracket_left_pipe_equal}); |
test/tests.zig+4-2| ... | ... | @@ -1002,8 +1002,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 1002 | 1002 | test_target.use_llvm == false and mem.eql(u8, options.name, "universal-libc")) |
| 1003 | 1003 | continue; |
| 1004 | 1004 | |
| 1005 | // TODO get std lib tests passing for self-hosted backends. | |
| 1006 | if (test_target.use_llvm == false and mem.eql(u8, options.name, "std")) | |
| 1005 | // TODO get std lib tests passing for other self-hosted backends. | |
| 1006 | if ((test_target.target.getCpuArch() != .x86_64 or | |
| 1007 | test_target.target.os_tag != .linux) and | |
| 1008 | test_target.use_llvm == false and mem.eql(u8, options.name, "std")) | |
| 1007 | 1009 | continue; |
| 1008 | 1010 | |
| 1009 | 1011 | const want_this_mode = for (options.optimize_modes) |m| { |