@@ -24,7 +24,7 @@ func TestMap(t *testing.T) {
24
24
25
25
var sampleBytes = []byte ("Decentralize everything!!!" )
26
26
var encodedSamples = map [Encoding ]string {
27
- Identity : string (0x00 ) + "Decentralize everything!!!" ,
27
+ Identity : string (rune ( 0x00 ) ) + "Decentralize everything!!!" ,
28
28
Base2 : "00100010001100101011000110110010101101110011101000111001001100001011011000110100101111010011001010010000001100101011101100110010101110010011110010111010001101000011010010110111001100111001000010010000100100001" ,
29
29
Base16 : "f446563656e7472616c697a652065766572797468696e67212121" ,
30
30
Base16Upper : "F446563656E7472616C697A652065766572797468696E67212121" ,
@@ -91,22 +91,22 @@ func TestRoundTrip(t *testing.T) {
91
91
continue
92
92
}
93
93
94
- _ , _ , err := Decode (string (base ) + "\u00A0 " )
94
+ _ , _ , err := Decode (string (rune ( base ) ) + "\u00A0 " )
95
95
if err == nil {
96
96
t .Fatal (EncodingToStr [base ] + " decode should fail on low-unicode" )
97
97
}
98
98
99
- _ , _ , err = Decode (string (base ) + "\u1F4A 8" )
99
+ _ , _ , err = Decode (string (rune ( base ) ) + "\u1F4A 8" )
100
100
if err == nil {
101
101
t .Fatal (EncodingToStr [base ] + " decode should fail on emoji" )
102
102
}
103
103
104
- _ , _ , err = Decode (string (base ) + "!" )
104
+ _ , _ , err = Decode (string (rune ( base ) ) + "!" )
105
105
if err == nil {
106
106
t .Fatal (EncodingToStr [base ] + " decode should fail on punctuation" )
107
107
}
108
108
109
- _ , _ , err = Decode (string (base ) + "\xA0 " )
109
+ _ , _ , err = Decode (string (rune ( base ) ) + "\xA0 " )
110
110
if err == nil {
111
111
t .Fatal (EncodingToStr [base ] + " decode should fail on high-latin1" )
112
112
}
0 commit comments