Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
zachallaun committed Jul 25, 2024
1 parent 2618593 commit 3616397
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions apps/remote_control/test/lexical/remote_control/build_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,30 @@ defmodule Lexical.BuildTest do
end
end

describe ".exs files" do
setup do
start_supervised!(RemoteControl.Dispatch)
start_supervised!(RemoteControl.ModuleMappings)
start_supervised!(Build.CaptureServer)
:ok
end

test "should not run top-level forms" do
source = ~S[
IO.puts("fail")
]

doc = Document.new("file:///file.exs", source, 0)

captured =
ExUnit.CaptureIO.capture_io(fn ->
Build.Document.compile(doc)
end)

refute captured =~ "fail"
end
end

if Features.after_verify?() do
describe "exceptions during compilation" do
test "compiling a project with callback errors" do
Expand Down

0 comments on commit 3616397

Please sign in to comment.