mirror of
https://github.com/samsonjs/csc360-a1-shell.git
synced 2026-03-25 08:45:52 +00:00
Fix tests on Ubuntu on GitHub Actions
This commit is contained in:
parent
7cb5697809
commit
2f4b5d904d
2 changed files with 9 additions and 8 deletions
8
Makefile
8
Makefile
|
|
@ -1,9 +1,7 @@
|
|||
default: all
|
||||
|
||||
all: c ruby
|
||||
default: c ruby
|
||||
|
||||
bootstrap:
|
||||
cd ruby && bundle
|
||||
cd ruby && bundle install --jobs 8
|
||||
|
||||
c:
|
||||
cd c && make test
|
||||
|
|
@ -15,4 +13,4 @@ clean:
|
|||
cd c && make clean
|
||||
cd ruby && bundle exec rake clean
|
||||
|
||||
.PHONY: c ruby clean
|
||||
.PHONY: c ruby clean bootstrap
|
||||
|
|
|
|||
|
|
@ -33,11 +33,13 @@ class ShellTest < Minitest::Test
|
|||
def test_background_job
|
||||
output = `#{A1_PATH} -c 'bg echo hello'`.gsub(/\e\[([;\d]+)?m/, "")
|
||||
pid = /\(pid (\d+)\)/.match(output)[1]
|
||||
assert_equal "Running job 1 (pid #{pid}) in background\nhello\n", output
|
||||
lines = output.split("\n").map(&:chomp)
|
||||
assert_equal ["Running job 1 (pid #{pid}) in background", "hello"], lines.sort
|
||||
end
|
||||
|
||||
def test_resolves_executables_with_absolute_paths
|
||||
assert_equal "/usr/bin/which", `#{A1_PATH} -c '/usr/bin/which -a which'`.chomp
|
||||
output = `#{A1_PATH} -c '/usr/bin/which -a which'`.lines.map(&:chomp)
|
||||
assert_includes output, "/usr/bin/which"
|
||||
end
|
||||
|
||||
def test_resolves_executables_with_relative_paths
|
||||
|
|
@ -47,7 +49,8 @@ class ShellTest < Minitest::Test
|
|||
end
|
||||
|
||||
def test_resolves_executables_in_absolute_paths
|
||||
assert_equal "/usr/bin/which", `#{A1_PATH} -c 'which -a which'`.chomp
|
||||
output = `#{A1_PATH} -c 'which -a which'`.lines.map(&:chomp)
|
||||
assert_includes output, "/usr/bin/which"
|
||||
end
|
||||
|
||||
def test_resolves_executables_in_relative_paths
|
||||
|
|
|
|||
Loading…
Reference in a new issue