fix tests
This commit is contained in:
parent
a9e4c5823a
commit
78cc7fab4b
1 changed files with 8 additions and 8 deletions
16
src/lang.zig
16
src/lang.zig
|
@ -665,18 +665,18 @@ pub const Lang = struct {
|
|||
};
|
||||
|
||||
test "noop" {
|
||||
var lang = Lang.init(std.heap.direct_allocator);
|
||||
var lang = Lang.init(std.testing.allocator);
|
||||
defer lang.deinit();
|
||||
|
||||
var cmds = try lang.parse("noop;");
|
||||
defer cmds.deinit();
|
||||
|
||||
std.testing.expectEqual(cmds.len, 1);
|
||||
std.testing.expectEqual(cmds.items[0].command, .Noop);
|
||||
std.testing.expectEqual(cmds.list.items.len, 1);
|
||||
std.testing.expectEqual(cmds.list.items[0].tag, .noop);
|
||||
}
|
||||
|
||||
test "load, phaser, quicksave" {
|
||||
var lang = Lang.init(std.heap.direct_allocator);
|
||||
var lang = Lang.init(std.testing.allocator);
|
||||
defer lang.deinit();
|
||||
|
||||
const prog =
|
||||
|
@ -688,8 +688,8 @@ test "load, phaser, quicksave" {
|
|||
var cmds = try lang.parse(prog);
|
||||
defer cmds.deinit();
|
||||
|
||||
std.testing.expectEqual(cmds.len, 3);
|
||||
std.testing.expectEqual(cmds.items[0].command, .Load);
|
||||
std.testing.expectEqual(cmds.items[1].command, .Phaser);
|
||||
std.testing.expectEqual(cmds.items[2].command, .Quicksave);
|
||||
std.testing.expectEqual(cmds.list.items.len, 3);
|
||||
std.testing.expectEqual(cmds.list.items[0].tag, .load);
|
||||
std.testing.expectEqual(cmds.list.items[1].tag, .phaser);
|
||||
std.testing.expectEqual(cmds.list.items[2].tag, .quicksave);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue