mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-10 11:09:50 +00:00
Add missing test
This commit is contained in:
parent
f5094c6428
commit
7a934a25f1
2 changed files with 24 additions and 0 deletions
|
|
@ -1522,3 +1522,19 @@ test "run allows warnings without blocking execution" {
|
|||
// Should produce output (runs successfully)
|
||||
try testing.expect(std.mem.indexOf(u8, run_result.stdout, "Hello, World!") != null);
|
||||
}
|
||||
|
||||
test "fx platform method inspect on string" {
|
||||
// Tests that calling .inspect() on a Str correctly reports MISSING METHOD
|
||||
// (Str doesn't have an inspect method, unlike custom opaque types)
|
||||
const allocator = testing.allocator;
|
||||
|
||||
const run_result = try runRoc(allocator, "test/fx/test_method_inspect.roc", .{});
|
||||
defer allocator.free(run_result.stdout);
|
||||
defer allocator.free(run_result.stderr);
|
||||
|
||||
// This should fail because Str doesn't have an inspect method
|
||||
try checkFailure(run_result);
|
||||
|
||||
// Should show MISSING METHOD error
|
||||
try testing.expect(std.mem.indexOf(u8, run_result.stderr, "MISSING METHOD") != null);
|
||||
}
|
||||
|
|
|
|||
8
test_type_error.roc
Normal file
8
test_type_error.roc
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
app [main!] { pf: platform "test/fx/platform/main.roc" }
|
||||
|
||||
import pf.Stdout
|
||||
|
||||
main! = || {
|
||||
x = 42
|
||||
Stdout.line!(x)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue