Skip to content

Commit

Permalink
todo: compile to check we actually return (i32 i32) for each Str from…
Browse files Browse the repository at this point in the history
… I32.match

Probably need to add a match or cond DSL
  • Loading branch information
RoyalIcing committed Aug 29, 2024
1 parent 0bf68b8 commit 98db425
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions test/i32/conveniences_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,23 @@ defmodule I32ConveniencesTest do
end

test "I32.match output string constant" do
assert (TestHelper.module_wat do
use Orb
wat =
TestHelper.module_wat do
use Orb

defw get_path(), I32.U8.UnsafePointer, state: I32 do
state = 0
defw get_path(), Str, state: I32 do
state = 0

I32.match state do
0 -> ~S[/initial]
1 -> ~S[/disconnected]
end
end
end) =~ "/initial"
I32.match state do
0 -> ~S[/initial]
1 -> ~S[/disconnected]
end
end
end

assert wat =~ "/initial"

# TODO: compile to check we actually return (i32 i32) for each Str.
end

test "can return string constant" do
Expand Down

0 comments on commit 98db425

Please sign in to comment.