1// Copyright 2015 Keybase, Inc. All rights reserved. Use of 2// this source code is governed by the included BSD license. 3 4package libkb 5 6import ( 7 "testing" 8 "testing/quick" 9) 10 11func TestHexEncoding(t *testing.T) { 12 f := func(x uint64) bool { 13 u := UHex{Val: x} 14 s := u.String() 15 for _, c := range s { 16 if c >= '0' && c <= '9' { 17 continue 18 } 19 if c >= 'a' && c <= 'f' { 20 continue 21 } 22 return false 23 } 24 return len(s) == 16 25 } 26 if err := quick.Check(f, nil); err != nil { 27 t.Error(err) 28 } 29} 30