-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathintegration_test.exs
More file actions
66 lines (50 loc) · 1.25 KB
/
integration_test.exs
File metadata and controls
66 lines (50 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
defmodule ElixirScript.Integration.Test do
use ElixirScript.Test
test "Something" do
assert {:ok, _} = {:ok, 1}
end
test "Atom.to_string" do
val = Atom.to_string(:atom)
assert val == "atom"
end
test "String interpolation with number" do
val = "#{5}"
assert val == "5"
end
test "shorthand failure" do
orders = [%{email: "[email protected]"}, %{email: "[email protected]"}]
val = Enum.reduce(orders, [],
&(&2 ++ [ [:option, %{value: &1.email}, &1.email] ]))
assert val == [
[:option, %{value: "[email protected]"}, "[email protected]"],
[:option, %{value: "[email protected]"}, "[email protected]"]
]
end
test "map equals" do
map1 = %{test: "map"}
map2 = %{test: "map"}
assert map1 == map2
end
test "multi-remote call" do
map = %{token_count: 5_000_000}
val = map.token_count.toLocaleString()
assert val == "5,000,000"
end
test "filter names in guards" do
has? = 5
val = case 5 do
_ when has? == 5 ->
true
end
assert val == true
end
test "tuple_get" do
map = %{{1} => 5}
val = Map.get(map, {1})
assert val == 5
end
test "multi_bind" do
[_a | _] = val = [1, 2, 3, 4, 5]
assert val == [1, 2, 3, 4, 5]
end
end