Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated the specs

  • Loading branch information...
commit 7c68f5a82016cd39e9759e1d15e2f35d1fd8f8e4 1 parent 4e1c523
@mattetti authored
Showing with 40 additions and 7 deletions.
  1. +2 −0  .gitignore
  2. +38 −7 spec/conformance_spec.rb
View
2  .gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+*/.DS_Store
View
45 spec/conformance_spec.rb
@@ -8,15 +8,16 @@
@handler = Multibyte::Handlers::UTF8HandlerProc
end
- describe "should be able to use normalizations C" do
+ describe "should be able to use normalization Form C" do
each_line_of_norm_tests do |*cols|
col1, col2, col3, col4, col5, comment = *cols
+ # CONFORMANCE:
+ # 1. The following invariants must be true for all conformant implementations
+ # NFC
+ # c2 == NFC(c1) == NFC(c2) == NFC(c3)
+
it "Form C - Col 2 has to be NFC(1) - #{comment}" do
- # CONFORMANCE:
- # 1. The following invariants must be true for all conformant implementations
- # NFC
- # c2 == NFC(c1) == NFC(c2) == NFC(c3)
@handler.normalize(col1, :c).ui.should == col2.ui
end
@@ -40,7 +41,7 @@
end
end
- describe "should be able to use normalizations D" do
+ describe "should be able to use normalization Form D" do
each_line_of_norm_tests do |*cols|
col1, col2, col3, col4, col5, comment = *cols
#
@@ -70,7 +71,7 @@
end
end
- describe 'should be able to use normalizations KC' do
+ describe 'should be able to use normalization Form KC' do
each_line_of_norm_tests do | *cols |
col1, col2, col3, col4, col5, comment = *cols
#
@@ -98,5 +99,35 @@
end
end
+
+ describe 'should be able to use nomalization Form KD' do
+ each_line_of_norm_tests do | *cols |
+ col1, col2, col3, col4, col5, comment = *cols
+ #
+ # NFKD
+ # c5 == NFKD(c1) == NFKD(c2) == NFKD(c3) == NFKD(c4) == NFKD(c5)
+ it "Form KD - Col 5 has to be NFKD(1) - #{comment}" do
+ @handler.normalize(col1, :kd).ui.should == col5.ui
+ end
+
+ it "Form KD - Col 5 has to be NFKD(2) - #{comment}" do
+ @handler.normalize(col2, :kd).ui.should == col5.ui
+ end
+
+ it "Form KD - Col 5 has to be NFKD(3) - #{comment}" do
+ @handler.normalize(col3, :kd).ui.should == col5.ui
+ end
+
+ it "Form KD - Col 5 has to be NFKD(4) - #{comment}" do
+ @handler.normalize(col4, :kd).ui.should == col5.ui
+ end
+
+ it "Form KD - Col 5 has to be NFKD(5) - #{comment}" do
+ @handler.normalize(col5, :kd).ui.should == col5.ui
+ end
+
+ end
+ end
+
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.