Skip to content

Commit a453ea1

Browse files
author
José Valim
committed
Fix usage of char_list and fix the build
1 parent 61fb890 commit a453ea1

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/elixir/test/elixir/kernel/cli_test.exs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,13 @@ defmodule Kernel.CLI.SyntaxErrorTest do
5757

5858
def check_output(elixir_cmd, expected_msg) do
5959
o = elixir(elixir_cmd)
60-
expected_msg = to_char_list(:unicode.characters_to_binary expected_msg)
60+
expected_msg = :unicode.characters_to_list(expected_msg)
6161
assert :string.str(o, expected_msg) == 1, "Expected this output: `#{expected_msg}`\nbut got this output: `#{o}`"
6262
end
6363

6464
test :syntax_code_error do
6565
check_output('-e "[1,2"', '** (TokenMissingError) nofile:1: missing terminator: ]')
6666
check_output('-e "case 1 end"', %C"** (SyntaxError) nofile:1: unexpected token: end")
67-
thischar = "あ"
68-
if is_win? do
69-
thatchar = %B"\x{3042}"
70-
else
71-
thatchar = :unicode.characters_to_binary(thischar)
72-
end
73-
check_output('-e "#{thischar}"', '** (SyntaxError) nofile:1: invalid token: #{thatchar}')
7467
check_output('-e "æ"', '** (SyntaxError) nofile:1: invalid token: æ')
7568
end
7669
end

lib/mix/lib/mix/shell.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ defmodule Mix.Shell do
6060
{ :unix, _ } ->
6161
command = command
6262
|> String.replace("\"", "\\\"")
63-
|> to_char_list
63+
|> binary_to_list # We need to send bytes, not chars
6464
%c(sh -c "#{command}")
6565

6666
{ :win32, osname } ->

0 commit comments

Comments
 (0)