commit 18b75d9d52446ca806468ff019c52fde9b1dd756
parent 04238b101d6ca652145eeec15fa049e5bbbeebbb
Author: Szymon Mikulicz <szymon.mikulicz@aptiv.com>
Date: Sat, 3 Aug 2024 21:40:44 +0200
Remove test
Diffstat:
1 file changed, 0 insertions(+), 42 deletions(-)
diff --git a/zlox/src/test.zig b/zlox/src/test.zig
@@ -1,42 +0,0 @@
-const std = @import("std");
-const chunk = @import("chunk.zig");
-const debug = @import("debug.zig");
-const vm = @import("vm.zig");
-const Trie = @import("trie.zig").TrieTable;
-
-test "testChunk" {
- var allocator = std.heap.GeneralPurposeAllocator(.{}){};
- defer std.debug.assert(allocator.deinit() == std.heap.Check.ok);
- var ch = try chunk.Chunk.init(allocator.allocator());
- defer ch.deinit();
- var VM = vm.VM.init();
- defer VM.deinit();
-
- try ch.writeOP(chunk.OP.CONSTANT, 123);
- try ch.write(try ch.addConstant(1.2), 123);
-
- try ch.writeOP(chunk.OP.CONSTANT, 123);
- try ch.write(try ch.addConstant(3.4), 123);
-
- try ch.writeOP(chunk.OP.ADD, 123);
-
- try ch.writeOP(chunk.OP.CONSTANT, 123);
- try ch.write(try ch.addConstant(5.6), 123);
-
- try ch.writeOP(chunk.OP.DIVIDE, 123);
-
- try ch.writeOP(chunk.OP.NEGATE, 123);
-
- try ch.writeOP(chunk.OP.RETURN, 123);
-
- try VM.interpretChunk(&ch);
-
- try std.testing.expect(VM.pop() == -((1.2 + 3.4) / 5.6));
-}
-
-test "testTrie" {
- const tr = Trie(u8, .{.{ "test", 16 }});
-
- try std.testing.expectEqual(tr.get("test").?, 16);
- try std.testing.expectEqual(tr.get("tes"), null);
-}