Skip to content

Commit

Permalink
heksa: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Jan 9, 2025
1 parent f663170 commit a27a2df
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions Formula/h/heksa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,9 @@ def install
end

test do

Check failure on line 32 in Formula/h/heksa.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew test --verbose heksa` failed on Linux!

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb:54:in `<main>'
require "pty"

r, _w, pid = PTY.spawn("#{bin}/heksa -l 16 -f asc -o no #{test_fixtures("test.png")}")

ENV["TERM"] = "xterm"
output = shell_output("#{bin}/heksa --limit 16 --format asc --offset-format no #{test_fixtures("test.png")}")
# remove ANSI colors
begin
output = r.read.gsub(/\e\[([;\d]+)?m/, "")
assert_match(/^.PNG/, output)
rescue Errno::EIO
# GNU/Linux raises EIO when read is done on closed pty
end

Process.wait(pid)
assert_equal 0, $CHILD_STATUS.exitstatus
assert_match(/^\.PNG/, output.gsub(/\e\[([;\d]+)?m/, ""))
end
end

0 comments on commit a27a2df

Please sign in to comment.