mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 01:21:38 -07:00
Fix issue parsing vendor/stb/image with the core:odin/parser parser
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user