MCPcopy Create free account
hub / github.com/Shopify/go-lua / TestReslicing

Function TestReslicing

go_test.go:40–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestReslicing(t *testing.T) {
41 a := [5]int{0, 1, 2, 3, 4}
42 s := a[:0]
43 if cap(s) != cap(a) {
44 t.Error("cap(s) != cap(a)")
45 }
46 if len(s) != 0 {
47 t.Error("len(s) != 0")
48 }
49 s = a[1:3]
50 if cap(s) == len(s) {
51 t.Error("cap(s) == len(s)")
52 }
53 s = s[:cap(s)]
54 if cap(s) != len(s) {
55 t.Error("cap(s) != len(s)")
56 }
57}
58
59func TestPow(t *testing.T) {
60 // if a, b := math.Pow(10.0, 33.0), 1.0e33; a != b {

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…