File: ensure_slice_test.go

package info (click to toggle)
golang-github-cheekybits-genny 1.0.0-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 336 kB
  • sloc: makefile: 17; sh: 3
file content (24 lines) | stat: -rw-r--r-- 374 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package slice

import (
	"log"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestEnsureSlice(t *testing.T) {

	myType := new(MyType)
	slice := EnsureSlice(myType)
	if assert.NotNil(t, slice) {
		assert.Equal(t, slice[0], myType)
	}

	slice = EnsureSlice(slice)
	log.Printf("%#v", slice[0])
	if assert.NotNil(t, slice) {
		assert.Equal(t, slice[0], myType)
	}

}