mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Install a temporary memory allocation solution to make the test work
This commit is contained in:
parent
a6e2f1152e
commit
39f6bde62c
1 changed files with 11 additions and 1 deletions
|
@ -251,10 +251,15 @@ pub fn expectFailed(
|
|||
failure_length += 1;
|
||||
}
|
||||
|
||||
pub fn getExpectFailures() [_]Failure {
|
||||
pub fn getExpectFailures() [*]Failure {
|
||||
return failures;
|
||||
}
|
||||
|
||||
pub fn deinitFailures() void {
|
||||
roc_dealloc(failures, @alignOf(Failure));
|
||||
failure_length = 0;
|
||||
}
|
||||
|
||||
pub fn unsafeReallocate(
|
||||
source_ptr: [*]u8,
|
||||
alignment: u32,
|
||||
|
@ -321,6 +326,11 @@ test "increfC, static data" {
|
|||
}
|
||||
|
||||
test "expectFailure does something"{
|
||||
//TODO: Fix whatever is causing this to error out
|
||||
// defer deinitFailures();
|
||||
// For now we're doing this instead:
|
||||
defer std.testing.allocator.destroy(@ptrCast(*[4096]u8, failures));
|
||||
|
||||
try std.testing.expectEqual(failure_length, 0);
|
||||
expectFailed(1, 2, 3, 4);
|
||||
try std.testing.expectEqual(failure_length, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue