@@ -119,27 +119,41 @@ defmodule Mix.Tasks.CompileTest do
119119
120120 File . mkdir_p! ( "lib/foo" )
121121
122- File . write! ( "lib/foo/z .ex" , """
123- defmodule Z do
122+ File . write! ( "lib/foo/z1 .ex" , """
123+ defmodule Z1 do
124124 def ok, do: :ok
125125 end
126126 """ )
127127
128128 assert :ok = Mix.Task . reenable ( "compile" )
129129 assert { :noop , [ ] } = Mix.Task . run ( "compile" )
130- refute File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z .beam" )
130+ refute File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z1 .beam" )
131131
132132 assert :ok = Mix.Task.Compiler . reenable ( compilers: [ ] )
133133 assert { :noop , [ ] } = Mix.Task . run ( "compile" )
134- refute File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z .beam" )
134+ refute File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z1 .beam" )
135135
136136 assert :ok = Mix.Task.Compiler . reenable ( compilers: [ "erlang" ] )
137137 assert { :noop , [ ] } = Mix.Task . run ( "compile" )
138- refute File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z .beam" )
138+ refute File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z1 .beam" )
139139
140140 assert :ok = Mix.Task.Compiler . reenable ( )
141141 assert { :ok , [ ] } = Mix.Task . run ( "compile" )
142- assert File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z.beam" )
142+ assert File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z1.beam" )
143+
144+ File . write! ( "lib/foo/z2.ex" , """
145+ defmodule Z2 do
146+ def ko, do: :ko
147+ end
148+ """ )
149+
150+ assert :ok = Mix.Task.Compiler . reenable ( compilers: [ :erlang ] )
151+ assert { :noop , [ ] } = Mix.Task . run ( "compile" )
152+ refute File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z2.beam" )
153+
154+ assert :ok = Mix.Task.Compiler . reenable ( compilers: [ :elixir ] )
155+ assert { :ok , [ ] } = Mix.Task . run ( :compile )
156+ assert File . regular? ( "_build/dev/lib/sample/ebin/Elixir.Z2.beam" )
143157 end )
144158 end
145159
0 commit comments