diff options
| author | Misty De Meo | 2014-03-10 10:27:24 -0700 |
|---|---|---|
| committer | Misty De Meo | 2014-03-13 09:45:31 -0700 |
| commit | 8b0de86a3949f6c70b8a61e8e0dc0f263a3ccbd9 (patch) | |
| tree | 8bd4f91f0802ef6ccc26ad46d4ffaad2160684fe /Library | |
| parent | 9b5eb30cd15f8f300fbf30733ae5ef4d268b158e (diff) | |
| download | homebrew-8b0de86a3949f6c70b8a61e8e0dc0f263a3ccbd9.tar.bz2 | |
yaz: add test
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/yaz.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 |
