bsdconv 11.4

also modernize the test

Closes #2751.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
ilovezfs 2016-07-06 02:08:56 -07:00
parent 6a3046cef6
commit 5597d22405

View file

@ -1,9 +1,8 @@
class Bsdconv < Formula
desc "Charset/encoding converter library"
homepage "https://github.com/buganini/bsdconv"
url "https://github.com/buganini/bsdconv/archive/11.3.1.tar.gz"
sha256 "b0656011fd40ec440e9966bba44d330a6213fdd198c487c87bc61869ef7fea9e"
url "https://github.com/buganini/bsdconv/archive/11.4.tar.gz"
sha256 "61919c8a7bae973794ef8b13c7e105ae4570cd832851570ca76a47c731cade6c"
head "https://github.com/buganini/bsdconv.git"
bottle do
@ -18,13 +17,8 @@ class Bsdconv < Formula
end
test do
require "open3"
Open3.popen3("#{bin}/bsdconv", "big5:utf-8") do |stdin, stdout, _|
stdin.write("\263\134\245\134\273\134")
stdin.close
result = stdout.read
result.force_encoding(Encoding::UTF_8) if result.respond_to?(:force_encoding)
assert_equal "許功蓋", result
end
output = pipe_output("#{bin}/bsdconv BIG5:UTF-8", "\263\134\273\134")
output.force_encoding("UTF-8") if output.respond_to?(:force_encoding)
assert_equal "許蓋", output
end
end