Skip to content

Commit 82c9a8a

Browse files
committed
Add tests
1 parent f2b0f31 commit 82c9a8a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

lib/iex/test/iex/config_test.exs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Code.require_file("../test_helper.exs", __DIR__)
2+
3+
defmodule IEx.ConfigTest do
4+
use ExUnit.Case, async: true
5+
6+
import IEx.Config
7+
8+
describe "prompt" do
9+
test "converts everything before opening parens to dots" do
10+
assert prompt(~c"iex(321)>") == ~c"...(321)>"
11+
assert prompt(~c"foo-bar(321)>") == ~c".......(321)>"
12+
end
13+
14+
test "falls back to Erlang wit no parens around" do
15+
assert prompt(~c"foo-bar>") == ~c" .. "
16+
end
17+
18+
test "ignores ansi escapes" do
19+
assert prompt(~c"#{IO.ANSI.red()}iex(foo)>") == ~c"...(foo)>"
20+
assert prompt(~c"#{IO.ANSI.red()}foo-bar>") == ~c" .. "
21+
end
22+
end
23+
end

0 commit comments

Comments
 (0)