diff options
Diffstat (limited to 'Master/texmf-dist/source/generic/hyph-utf8/spec')
-rw-r--r-- | Master/texmf-dist/source/generic/hyph-utf8/spec/spec_helper.rb | 1 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/language_spec.rb | 28 |
2 files changed, 23 insertions, 6 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/spec/spec_helper.rb b/Master/texmf-dist/source/generic/hyph-utf8/spec/spec_helper.rb index da5b4252148..08dd5b96b7c 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/spec/spec_helper.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/spec/spec_helper.rb @@ -3,5 +3,6 @@ require 'tex/hyphen/language' require 'tex/hyphen/texlive/package' require 'tex/hyphen/texlive' require 'tex/hyphen/texlive/loader' +require 'tex/hyphen/converter' RSpec::Expectations.configuration.on_potential_false_positives = :nothing diff --git a/Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/language_spec.rb b/Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/language_spec.rb index 4805b1878db..93f42c462d1 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/language_spec.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/language_spec.rb @@ -124,7 +124,7 @@ describe Language do it "lists all languages" do # All the TeX files. Note [no] and [mn-cyrl-x-lmc] don’t have corresponding plain text files. - expect(Language.languages.count).to eq 82 # Was 79; 3 more “TeX Live dummies” [ar] [fa] [grc-x-ibycus] TODO Maybe remove + expect(Language.languages.count).to eq 83 # Was 79; 3 more “TeX Live dummies” [ar] [fa] [grc-x-ibycus] TODO Maybe remove end end @@ -134,7 +134,7 @@ describe Language do end it "returns 81 languages" do # That’s all of them except for [sr-cyrl] - expect(Language.all.count).to eq 81 + expect(Language.all.count).to eq 82 end end @@ -737,10 +737,8 @@ describe Language do expect(Language.new('ka').list_run_files).to eq ['tex/generic/hyph-utf8/loadhyph/loadhyph-ka.tex', 'tex/generic/hyph-utf8/patterns/tex/hyph-ka.tex', 'tex/generic/hyph-utf8/patterns/ptex/hyph-ka.t8m.tex', - 'tex/generic/hyph-utf8/patterns/txt/hyph-ka.chr.txt', 'tex/generic/hyph-utf8/patterns/txt/hyph-ka.pat.txt', - 'tex/generic/hyph-utf8/patterns/txt/hyph-ka.hyp.txt', - 'tex/generic/hyph-utf8/patterns/txt/hyph-ka.lic.txt'] + 'tex/generic/hyph-utf8/patterns/txt/hyph-ka.hyp.txt'] end end @@ -963,7 +961,7 @@ describe Package do it "lists the run-time files" do # pending "it crashes ;-)" norwegian_run = norwegian.list_run_files - expect(norwegian_run.count).to eq 15 + expect(norwegian_run.count).to eq 11 expect(norwegian_run.select { |f| f =~ /tex\/hyph-[^\.]*\.tex$/ }).to eq ['tex/generic/hyph-utf8/patterns/tex/hyph-no.tex', 'tex/generic/hyph-utf8/patterns/tex/hyph-nb.tex', 'tex/generic/hyph-utf8/patterns/tex/hyph-nn.tex'] @@ -983,3 +981,21 @@ describe Package do end end end + +describe Converter do + describe '#read' do + it "reads the conversion data" do + converter = Converter.new + converter.read(File.join(File.expand_path(__dir__), '..', '..', '..', 'data', 'encodings', 'macedonian.dat')) + puts converter.instance_variable_get(:@mapping) + end + end + + describe '#convert' do + it "runs one pass through the file" do + converter = Converter.new + converter.read(File.join(File.expand_path(__dir__), '..', '..', '..', 'data', 'encodings', 'macedonian.dat')) + converter.convert(File.join(File.expand_path(__dir__), '..', '..', '..', '..', '..', '..', '..', 'old', 'other', 'mk', 'mkhyphen.tex')) + end + end +end |