We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9f7d4e commit 5312f76Copy full SHA for 5312f76
test/components_guide/rustler/math_test.exs
@@ -0,0 +1,25 @@
1
+defmodule ComponentsGuide.Rustler.MathTest do
2
+ use ExUnit.Case, async: true
3
+
4
+ alias ComponentsGuide.Rustler.Math
5
6
+ test "add/2" do
7
+ assert Math.add(3, 4) == 7
8
+ end
9
10
+ test "reverse_string/1" do
11
+ assert Math.reverse_string("abcd") == "dcba"
12
13
14
+ test "wasm_example/2" do
15
+ wasm_source = """
16
+ (module
17
+ (func (export "answer") (result i32)
18
+ i32.const 42
19
+ )
20
21
+ """
22
23
+ assert Math.wasm_example(wasm_source, "answer") == 42
24
25
+end
0 commit comments