From 8b0de86a3949f6c70b8a61e8e0dc0f263a3ccbd9 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Mon, 10 Mar 2014 10:27:24 -0700 Subject: yaz: add test --- Library/Formula/yaz.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/yaz.rb b/Library/Formula/yaz.rb index 3a6233781..9c1a1b5e0 100644 --- a/Library/Formula/yaz.rb +++ b/Library/Formula/yaz.rb @@ -1,3 +1,4 @@ +# -*- coding: UTF-8 -*- require 'formula' class Yaz < Formula @@ -21,4 +22,15 @@ class Yaz < Formula "--with-xml2" system "make install" end + + # This test converts between MARC8, an obscure mostly-obsolete library + # text encoding supported by yaz-iconv, and UTF8. + test do + marc8 = File.open('marc8.txt', 'w') do |f| + f.write '$1!0-!L,i$3i$si$Ki$Ai$O!+=(B' + end + + result = `"#{bin}/yaz-iconv" -f marc8 -t utf8 marc8.txt`.chomp + assert_equal "世界こんにちは!", result + end end -- cgit v1.2.3