| 1 | const std = @import("std"); |
| 2 | const testing = std.testing; |
| 3 | const lua = @import("lua"); |
| 4 | const Config = lua.config_mod.Config; |
| 5 | |
| 6 | test "test-config.lua loads without errors" { |
| 7 | var cfg = Config.init(testing.allocator); |
| 8 | defer cfg.deinit(); |
| 9 | |
| 10 | const initialized = lua.init(&cfg); |
| 11 | if (!initialized) { |
| 12 | return error.LuaInitFailed; |
| 13 | } |
| 14 | defer lua.deinit(); |
| 15 | |
| 16 | const loaded = lua.loadFile("resources/test-config.lua"); |
| 17 | try testing.expect(loaded); |
| 18 | } |