Skip to content

Instantly share code, notes, and snippets.

@wsmoak
Last active September 7, 2015 19:06
Show Gist options
  • Save wsmoak/299c81607dcd1306a048 to your computer and use it in GitHub Desktop.
Save wsmoak/299c81607dcd1306a048 to your computer and use it in GitHub Desktop.
elixir test failure with different version number
PROBLEM: Changing the version number makes a bunch of tests fail
SOLUTION: Avoid adding a newline to the VERSION file. Edit with `vim -b VERSION`.
$ git remote -v
origin https://github.com/elixir-lang/elixir.git (fetch)
origin https://github.com/elixir-lang/elixir.git (push)
$ git log | head
commit 1660d7d5c910e479d2db8963c3b9766183a89b64
Merge: b5322b1 a251ccc
Author: José Valim <jose.valim@gmail.com>
Date: Mon Sep 7 20:23:03 2015 +0200
Merge pull request #3686 from eksperimental/correct_raise
Format raise message consistently
commit a251ccc722a3736a5a5f79edcb69b5fb749b3738
$ git diff
diff --git a/VERSION b/VERSION
index 2ff3577..e9dffda 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.1.0-beta
\ No newline at end of file
+1.1.0-wsmoak
diff --git a/src/elixir.app.src b/src/elixir.app.src
index 3c099d4..b0afe3b 100644
--- a/src/elixir.app.src
+++ b/src/elixir.app.src
@@ -1,6 +1,6 @@
{application, elixir,
[{description, "elixir"},
- {vsn, "1.1.0-beta"},
+ {vsn, "1.1.0-wsmoak"},
{modules, [
elixir
]},
$ make clean test
[...]
Randomized with seed 119063
==> iex (exunit)
..............................
1) test import_file helper (IEx.HelpersTest)
test/iex/helpers_test.exs:134
match (=) failed
code: "** (CompileError) iex:1: undefined function variable/0" <> _ = capture_iex("variable")
rhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n** (CompileError) iex:1: undefined function variable/0"
stacktrace:
test/iex/helpers_test.exs:136: anonymous fn/0 in IEx.HelpersTest.test import_file helper/1
test/iex/helpers_test.exs:383: IEx.HelpersTest.with_file/3
test/iex/helpers_test.exs:135
........
2) test pid helper (IEx.HelpersTest)
test/iex/helpers_test.exs:326
Assertion with == failed
code: "#PID<0.32767.3276>" == capture_iex("pid(0,32767,3276)")
lhs: "#PID<0.32767.3276>"
rhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n#PID<0.32767.3276>"
stacktrace:
test/iex/helpers_test.exs:327
..
3) test h helper (IEx.HelpersTest)
test/iex/helpers_test.exs:18
match (=) failed
code: "* IEx.Helpers\n\nWelcome to Interactive Elixir" <> _ = capture_iex("h")
rhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n* IEx.Helpers\n\nWelcome to Interactive Elixir. You are currently\nseeing the documentation for the module `IEx.Helpers`\nwhich provides many helpers to make Elixir's shell\nmore joyful to work with.\n\nThis message was triggered by invoking the helper\n`h()`, usually referred to as `h/0` (since it expects 0\narguments).\n\nThere are many other helpers available:\n\n * `b/1` - prints callbacks info and docs for a given module\n * `c/2` — compiles a file at the given path\n * `cd/1` — changes the current directory\n * `clear/0` — clears the screen\n * `flush/0` — flushes all messages sent to the shell\n * `h/0` — prints this help message\n * `h/1` — prints help for the given module, function or macro\n * `l/1` — loads the given module's beam code\n * `ls/0` — lists the contents of the current directory\n * `ls/1` — lists the contents of the specified directory\n * `pid/3` — creates a PID with the 3 integer arguments passed\n * `pwd/0` — prints the current working directory\n * `r/1` — recompiles and reloads the given module's source file\n * `respawn/0` — respawns the current shell\n * `s/1` — prints spec information\n * `t/1` — prints type information\n * `v/0` — retrieves the last value from the history\n * `v/1` — retrieves the nth value from the history\n * `import_file/1` — evaluates the given file in the shell's context\n\nHelp for functions in this module can be consulted\ndirectly from the command line, as an example, try:\n\n h(c/2)\n\nYou can also retrieve the documentation for any module\nor function. Try these:\n\n h(Enum)\n h(Enum.reverse/1)\n\nTo discover all available functions for a module, type the module name\nfollowed by a dot, then press tab to trigger autocomplete. For example:\n\n Enum.\n\nTo learn more about IEx as a whole, just type `h(IEx)`."
stacktrace:
test/iex/helpers_test.exs:19
....
4) test import_file nested (IEx.HelpersTest)
test/iex/helpers_test.exs:146
match (=) failed
code: "** (CompileError) iex:1: undefined function parent/0" <> _ = capture_iex("parent")
rhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n** (CompileError) iex:1: undefined function parent/0"
stacktrace:
test/iex/helpers_test.exs:151: anonymous fn/0 in IEx.HelpersTest.test import_file nested/1
test/iex/helpers_test.exs:383: IEx.HelpersTest.with_file/3
test/iex/helpers_test.exs:150
.
5) test import_file when the file is missing (IEx.HelpersTest)
test/iex/helpers_test.exs:161
Assertion with == failed
code: "nil" == capture_iex("import_file \"nonexistent\", optional: true")
lhs: "nil"
rhs: ") - press Ctrl+C to exit (type h() ENTER for help)\nnil"
stacktrace:
test/iex/helpers_test.exs:162
.
6) test clear helper (IEx.HelpersTest)
test/iex/helpers_test.exs:8
Assertion with == failed
code: capture_iex("clear") == "\e[H\e[2J"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n\e[H\e[2J"
rhs: "\e[H\e[2J"
stacktrace:
test/iex/helpers_test.exs:10
...
7) test v helper (IEx.HelpersTest)
test/iex/helpers_test.exs:102
match (=) failed
code: "** (RuntimeError) v(0) is out of bounds" <> _ = capture_iex("v(0)")
rhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n** (RuntimeError) v(0) is out of bounds\n (iex) lib/iex/history.ex:121: IEx.History.nth/2\n (iex) lib/iex/helpers.ex:288: IEx.Helpers.v/1"
stacktrace:
test/iex/helpers_test.exs:103
8) test no break (IEx.InteractionTest)
test/iex/interaction_test.exs:56
Assertion with == failed
code: capture_iex(input) == ""
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)"
rhs: ""
stacktrace:
test/iex/interaction_test.exs:62
9) test prompt (IEx.InteractionTest)
test/iex/interaction_test.exs:92
Assertion with == failed
code: capture_iex("1\n", opts, [], true) == "prompt(1)> 1\nprompt(2)>"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\nprompt(1)> 1\nprompt(2)>"
rhs: "prompt(1)> 1\nprompt(2)>"
stacktrace:
test/iex/interaction_test.exs:94
10) test nested .iex (IEx.InteractionTest)
test/iex/interaction_test.exs:133
Assertion with == failed
code: capture_iex(input, [], dot_iex_path: "dot-iex") == "13\n14\nhello\n:ok"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n13\n14\nhello\n:ok"
rhs: "13\n14\nhello\n:ok"
stacktrace:
test/iex/interaction_test.exs:138
.
11) test history size (IEx.InteractionTest)
test/iex/interaction_test.exs:112
Assertion with == failed
code: capture_iex("1\n2\n3\nv(1)", opts) == "1\n2\n3\n1"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n1\n2\n3\n1"
rhs: "1\n2\n3\n1"
stacktrace:
test/iex/interaction_test.exs:114
.....
12) test .iex (IEx.InteractionTest)
test/iex/interaction_test.exs:126
Assertion with == failed
code: capture_iex("my_variable", [], dot_iex_path: "dot-iex") == "144"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n144"
rhs: "144"
stacktrace:
test/iex/interaction_test.exs:128
13) test empty input (IEx.InteractionTest)
test/iex/interaction_test.exs:15
Assertion with == failed
code: capture_iex("\n") == "nil"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\nnil"
rhs: "nil"
stacktrace:
test/iex/interaction_test.exs:16
14) test no .iex (IEx.InteractionTest)
test/iex/interaction_test.exs:122
match (=) failed
code: "** (CompileError) iex:1: undefined function my_variable/0" <> _ = capture_iex("my_variable")
rhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n** (CompileError) iex:1: undefined function my_variable/0"
stacktrace:
test/iex/interaction_test.exs:123
15) test inspect opts (IEx.InteractionTest)
test/iex/interaction_test.exs:106
Assertion with == failed
code: capture_iex("<<45, 46, 47>>\n[45, 46, 47]\n%IO.Stream{}", opts) == "<<45, 46, 47>>\n[45, 46, 47]\n%{__struct__: IO.Stream, device: nil, line_or_bytes: :line, raw: true}"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n<<45, 46, 47>>\n[45, 46, 47]\n%{__struct__: IO.Stream, device: nil, line_or_bytes: :line, raw: true}"
rhs: "<<45, 46, 47>>\n[45, 46, 47]\n%{__struct__: IO.Stream, device: nil, line_or_bytes: :line, raw: true}"
stacktrace:
test/iex/interaction_test.exs:108
...
16) test exception (IEx.InteractionTest)
test/iex/interaction_test.exs:40
Assertion with =~ failed
code: capture_iex("1 + :atom\n:this_is_still_working") =~ ~r"^#{exception}.+\\n:this_is_still_working$"s
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n** (ArithmeticError) bad argument in arithmetic expression\n :erlang.+(1, :atom)\n:this_is_still_working"
rhs: ~r/^\*\*\ \(ArithmeticError\)\ bad\ argument\ in\ arithmetic\ expression.+\n:this_is_still_working$/s
stacktrace:
test/iex/interaction_test.exs:42
17) test normal input (IEx.InteractionTest)
test/iex/interaction_test.exs:19
Assertion with == failed
code: capture_iex("1 + 2") == "3"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n3"
rhs: "3"
stacktrace:
test/iex/interaction_test.exs:20
18) test color (IEx.InteractionTest)
test/iex/interaction_test.exs:98
Assertion with == failed
code: capture_iex("1 + 2", opts) == "\e[31m3\e[0m"
lhs: ") - press Ctrl+C to exit (type h() ENTER for help)\n\e[31m3\e[0m"
rhs: "\e[31m3\e[0m"
stacktrace:
test/iex/interaction_test.exs:100
..
Finished in 1.6 seconds (0.7s on load, 0.8s on tests)
78 tests, 18 failures
Randomized with seed 404529
make: *** [test_iex] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment