Implemented a few basic tests and ideas for future ones
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
const std = @import("std");
|
||||
const rl = @import("raylib");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
const c = @import("../constants.zig");
|
||||
const Node = @import("node.zig").Node;
|
||||
@@ -41,6 +39,9 @@ pub const Road = struct {
|
||||
}
|
||||
};
|
||||
|
||||
const std = @import("std");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
test "valid road nodes" {
|
||||
var gpa: std.heap.DebugAllocator(.{}) = .init;
|
||||
defer _ = gpa.deinit();
|
||||
@@ -64,5 +65,6 @@ test "valid road nodes" {
|
||||
|
||||
const road: Road = .init(11, start_ptr, end_ptr);
|
||||
|
||||
try expect(road.nodes[0].id == 34 and road.nodes[1].id == 227);
|
||||
try expect(road.nodes[0].id == 34);
|
||||
try expect(road.nodes[1].id == 227);
|
||||
}
|
||||
Reference in New Issue
Block a user