aboutsummaryrefslogtreecommitdiff
path: root/tests/core
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-06-18 21:45:15 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-06-22 09:42:33 -0400
commitfc58158fb76ea76c59454b3d201dfac182a61e73 (patch)
tree87e87cccb9f5cb501e13b7a7f4d3b34097176064 /tests/core
parent757c243aaf73e8bc75dbe592817d56794f0ee5ca (diff)
Fix issue parsing `vendor/stb/image` with the `core:odin/parser` parser
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/odin/test_parser.odin28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/core/odin/test_parser.odin b/tests/core/odin/test_parser.odin
index b4310104f..cc180f9af 100644
--- a/tests/core/odin/test_parser.odin
+++ b/tests/core/odin/test_parser.odin
@@ -66,3 +66,31 @@ Foo :: bit_field uint {
ok := parser.parse_file(&p, &file)
testing.expect(t, ok, "bad parse")
}
+
+@test
+test_parse_parser :: proc(t: ^testing.T) {
+ context.allocator = context.temp_allocator
+ runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD()
+
+ pkg, ok := parser.parse_package_from_path(ODIN_ROOT + "core/odin/parser")
+
+ testing.expect(t, ok, "parser.parse_package_from_path failed")
+
+ for key, value in pkg.files {
+ testing.expectf(t, value.syntax_error_count == 0, "%v should contain zero errors", key)
+ }
+}
+
+@test
+test_parse_stb_image :: proc(t: ^testing.T) {
+ context.allocator = context.temp_allocator
+ runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD()
+
+ pkg, ok := parser.parse_package_from_path(ODIN_ROOT + "vendor/stb/image")
+
+ testing.expect(t, ok, "parser.parse_package_from_path failed")
+
+ for key, value in pkg.files {
+ testing.expectf(t, value.syntax_error_count == 0, "%v should contain zero errors", key)
+ }
+}