diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-21 22:18:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-21 22:18:35 +0000 |
commit | 0ed350c60624a3a8d3de8982910e34f8b306b6d2 (patch) | |
tree | 58ff50b634e1f80f22619664753141eb76a65805 /Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/converter_spec.rb | |
parent | 0f67bb16431a1ef46f820429fa885994b04cabc1 (diff) |
hyph-utf main (21mar21)
git-svn-id: svn://tug.org/texlive/trunk@58609 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/converter_spec.rb')
-rw-r--r-- | Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/converter_spec.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/converter_spec.rb b/Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/converter_spec.rb new file mode 100644 index 00000000000..ff8c258f44a --- /dev/null +++ b/Master/texmf-dist/source/generic/hyph-utf8/spec/tex/hyphen/converter_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +include TeX::Hyphen + +describe Converter do + describe '.scan_line' do + it "scans the line" do + eightbits, usv = Converter.scan_line "0xDF\tU+042F" + expect(eightbits).to eq 223 + expect(usv).to eq 'Я' + end + + it "can read an optional name" do + eightbits, usv, bool, name = Converter.scan_line "0x2E\tU+002E\t\tperiod" + expect(eightbits).to eq 46 + expect(usv).to eq '.' + expect(bool).to eq 0 + expect(name).to eq 'period' + end + + it "doesn’t crash if there is no match" do + expect { Converter.scan_line "" }.not_to raise_exception + end + + it "returns nil if there are no matches" do + b = Converter.scan_line "0x2F" + expect(b).to be_nil + end + + it "can also have a useless strange entry" do + eightbits, usv, bool, name = Converter.scan_line "0x19\tU+0131\t1\tdotlessi" + expect(eightbits).to eq 25 + expect(usv).to eq 'ı' + expect(bool).to eq 1 + expect(name).to eq 'dotlessi' + end + end +end |