MCPcopy Index your code
hub / github.com/flike/kingshard / TestString

Function TestString

core/hack/hack_test.go:22–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20)
21
22func TestString(t *testing.T) {
23 b := []byte("hello world")
24 a := String(b)
25
26 if a != "hello world" {
27 t.Fatal(a)
28 }
29
30 b[0] = 'a'
31
32 if a != "aello world" {
33 t.Fatal(a)
34 }
35
36 b = append(b, "abc"...)
37 if a != "aello world" {
38 t.Fatal(a)
39 }
40}
41
42func TestByte(t *testing.T) {
43 a := "hello world"

Callers

nothing calls this directly

Calls 1

StringFunction · 0.70

Tested by

no test coverage detected