spec/format_spec.rb in asciipack-0.1.2 vs spec/format_spec.rb in asciipack-0.1.3

- old
+ new

@@ -72,32 +72,32 @@ expect(AsciiPack.pack(Float::NAN)).to eq(T.float64 + '7fffffffffffffff') expect(AsciiPack.pack(1 / 0.0)).to eq(T.float64 + '7ff0000000000000') expect(AsciiPack.pack(-1 / 0.0)).to eq(T.float64 + 'fff0000000000000') end - it "fixstr" do - format "", T.fixstr_0, 1 - format " ", T.fixstr_1, 2 - format "あ", T.fixstr_1, 2 - format "漢字", T.fixstr_2, 3 - format " " * 0xe, T.fixstr_E, 15 - format " " * 0xf, T.fixstr_F, 16 + it "fixbin" do + format "", T.fixbin_0, 1 + format " ", T.fixbin_1, 2 + format "あ", T.fixbin_1, 2 + format "漢字", T.fixbin_2, 3 + format " " * 0xe, T.fixbin_E, 15 + format " " * 0xf, T.fixbin_F, 16 end - it "str 8" do - format "a" * 0x10, T.str8, 3 + 0x10 - format "a" * 0xff, T.str8, 3 + 0xff + it "bin 8" do + format "a" * 0x10, T.bin8, 3 + 0x10 + format "a" * 0xff, T.bin8, 3 + 0xff end - it "str 16" do - format "a" * 0x100, T.str16, 5 + 0x100 - format "a" * 0xffff, T.str16, 5 + 0xffff + it "bin 16" do + format "a" * 0x100, T.bin16, 5 + 0x100 + format "a" * 0xffff, T.bin16, 5 + 0xffff end - it "str 32" do - format "a" * 0x10000, T.str32, 9 + 0x10000 + it "bin 32" do + format "a" * 0x10000, T.bin32, 9 + 0x10000 # FIXME too late - # format "a" * 0xffffffff, T.str32, 9 + 0xffffffff + # format "a" * 0xffffffff, T.bin32, 9 + 0xffffffff end it "map 4" do format_map 0, T.map4 format_map 0xf, T.map4