Commit ffd30dbe28

Benjamin Feng <benjamin.feng@glassdoor.com>
2020-01-29 22:30:13
Fix stage1 test
1 parent c4e6e5f
Changed files (1)
test
stage1
test/stage1/behavior/const_slice_child.zig
@@ -1,6 +1,7 @@
 const std = @import("std");
 const debug = std.debug;
-const expect = std.testing.expect;
+const testing = std.testing;
+const expect = testing.expect;
 
 var argv: [*]const [*]const u8 = undefined;
 
@@ -23,6 +24,7 @@ fn foo(args: [][]const u8) void {
 
 fn bar(argc: usize) void {
     const args = testing.leak_count_allocator.alloc([]const u8, argc) catch unreachable;
+    defer testing.leak_count_allocator.free(args);
     for (args) |_, i| {
         const ptr = argv[i];
         args[i] = ptr[0..strlen(ptr)];