-
Notifications
You must be signed in to change notification settings - Fork 0
/
kidwords_test.go
38 lines (34 loc) · 895 Bytes
/
kidwords_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package kidwords
import "fmt"
// func TestIntTransformations(t *testing.T) {
// cases := []int64{0, 9, 16, 32, 999999, 38729387428974, 2374761653249823, 88999999}
// for _, i := range cases {
// t.Run(fmt.Sprintf("transforming integer: %d", i), func(t *testing.T) {
// b := &bytes.Buffer{}
// if err := WriteInt(b, i); err != nil {
// t.Fatal(err)
// }
// legitWords(t, b.String())
// t.Log("words:", b.String())
//
// j, err := ReadInt(bytes.NewReader(b.Bytes()))
// if err != nil {
// t.Fatal(err)
// }
// if j != i {
// t.Fatalf("%d does not match %d", j, i)
// }
// })
// }
// }
func ExampleFromBytes() {
fmt.Println(
FromBytes([]byte("marvel")),
)
// Output: hole gold hush item half hint <nil>
}
func ExampleToBytes() {
b, err := ToBytes(" hole gold hush item half hint ")
fmt.Println(string(b), err)
// Output: marvel <nil>
}