1
0
mirror of https://github.com/golang/go synced 2024-11-26 06:07:57 -07:00

Verify that "byte" is an alias for "uint8".

R=r
DELTA=6  (6 added, 0 deleted, 0 changed)
OCL=26836
CL=26841
This commit is contained in:
Ian Lance Taylor 2009-03-27 13:43:50 -07:00
parent c5c577c1ff
commit 5617028ab6

View File

@ -161,6 +161,12 @@ func TestAll(tt *testing.T) { // TODO(r): wrap up better
value := reflect.NewValue(tmp);
assert(reflect.valueToString(value), "123.4");
}
{
var tmp = byte(123);
value := reflect.NewValue(tmp);
assert(reflect.valueToString(value), "123");
assert(reflect.typeToString(value.Type(), false), "uint8");
}
{ var tmp = "abc";
value := reflect.NewValue(tmp);
assert(reflect.valueToString(value), "abc");