github.com/johnnyeven/libtools@v0.0.0-20191126065708-61829c1adf46/codegen/importer_test.go (about)

     1  package codegen
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestImports(t *testing.T) {
    10  	tt := assert.New(t)
    11  	imports := Importer{}
    12  
    13  	tt.Equal(`[]string{"1", "2"}`, imports.Sdump([]string{"1", "2"}))
    14  	tt.Equal(`[]interface {}{"1", nil}`, imports.Sdump([]interface{}{"1", nil}))
    15  	tt.Equal(`map[string]int{"1": 2}`, imports.Sdump(map[string]int{"1": 2}))
    16  }