@@ -24,7 +24,7 @@ func TestMap(t *testing.T) {
2424
2525var sampleBytes = []byte ("Decentralize everything!!!" )
2626var encodedSamples = map [Encoding ]string {
27- Identity : string (0x00 ) + "Decentralize everything!!!" ,
27+ Identity : string (rune ( 0x00 ) ) + "Decentralize everything!!!" ,
2828 Base2 : "00100010001100101011000110110010101101110011101000111001001100001011011000110100101111010011001010010000001100101011101100110010101110010011110010111010001101000011010010110111001100111001000010010000100100001" ,
2929 Base16 : "f446563656e7472616c697a652065766572797468696e67212121" ,
3030 Base16Upper : "F446563656E7472616C697A652065766572797468696E67212121" ,
@@ -91,22 +91,22 @@ func TestRoundTrip(t *testing.T) {
9191 continue
9292 }
9393
94- _ , _ , err := Decode (string (base ) + "\u00A0 " )
94+ _ , _ , err := Decode (string (rune ( base ) ) + "\u00A0 " )
9595 if err == nil {
9696 t .Fatal (EncodingToStr [base ] + " decode should fail on low-unicode" )
9797 }
9898
99- _ , _ , err = Decode (string (base ) + "\u1F4A 8" )
99+ _ , _ , err = Decode (string (rune ( base ) ) + "\u1F4A 8" )
100100 if err == nil {
101101 t .Fatal (EncodingToStr [base ] + " decode should fail on emoji" )
102102 }
103103
104- _ , _ , err = Decode (string (base ) + "!" )
104+ _ , _ , err = Decode (string (rune ( base ) ) + "!" )
105105 if err == nil {
106106 t .Fatal (EncodingToStr [base ] + " decode should fail on punctuation" )
107107 }
108108
109- _ , _ , err = Decode (string (base ) + "\xA0 " )
109+ _ , _ , err = Decode (string (rune ( base ) ) + "\xA0 " )
110110 if err == nil {
111111 t .Fatal (EncodingToStr [base ] + " decode should fail on high-latin1" )
112112 }
0 commit comments