Skip to content

Commit

Permalink
Fix spec for String#encode and String.new on DragonFlyBSD (crysta…
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr authored Nov 4, 2023
1 parent b57aa37 commit 4ea385a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/std/string_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2755,7 +2755,7 @@ describe "String" do
bytes.to_a.should eq([72, 0, 101, 0, 108, 0, 108, 0, 111, 0])
end

{% unless flag?(:musl) || flag?(:freebsd) %}
{% unless flag?(:musl) || flag?(:freebsd) || flag?(:dragonfly) %}
it "flushes the shift state (#11992)" do
"\u{00CA}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x66])
"\u{00CA}\u{0304}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x62])
Expand All @@ -2764,7 +2764,7 @@ describe "String" do

# FreeBSD iconv encoder expects ISO/IEC 10646 compatibility code points,
# see https://www.ccli.gov.hk/doc/e_hkscs_2008.pdf for details.
{% if flag?(:freebsd) %}
{% if flag?(:freebsd) || flag?(:dragonfly) %}
it "flushes the shift state (#11992)" do
"\u{F329}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x66])
"\u{F325}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x62])
Expand Down Expand Up @@ -2808,7 +2808,7 @@ describe "String" do
String.new(bytes, "UTF-16LE").should eq("Hello")
end

{% unless flag?(:freebsd) %}
{% unless flag?(:freebsd) || flag?(:dragonfly) %}
it "decodes with shift state" do
String.new(Bytes[0x88, 0x66], "BIG5-HKSCS").should eq("\u{00CA}")
String.new(Bytes[0x88, 0x62], "BIG5-HKSCS").should eq("\u{00CA}\u{0304}")
Expand All @@ -2817,7 +2817,7 @@ describe "String" do

# FreeBSD iconv decoder returns ISO/IEC 10646-1:2000 code points,
# see https://www.ccli.gov.hk/doc/e_hkscs_2008.pdf for details.
{% if flag?(:freebsd) %}
{% if flag?(:freebsd) || flag?(:dragonfly) %}
it "decodes with shift state" do
String.new(Bytes[0x88, 0x66], "BIG5-HKSCS").should eq("\u{00CA}")
String.new(Bytes[0x88, 0x62], "BIG5-HKSCS").should eq("\u{F325}")
Expand Down

0 comments on commit 4ea385a

Please sign in to comment.