mirror of https://github.com/pulumi/pulumi.git
25 lines
518 B
Go
25 lines
518 B
Go
package cmd
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestStringifyOutput(t *testing.T) {
|
|
num := 42
|
|
str := "ABC"
|
|
arr := []string{"hello", "goodbye"}
|
|
obj := map[string]interface{}{
|
|
"foo": 42,
|
|
"bar": map[string]interface{}{
|
|
"baz": true,
|
|
},
|
|
}
|
|
|
|
assert.Equal(t, "42", stringifyOutput(num))
|
|
assert.Equal(t, "ABC", stringifyOutput(str))
|
|
assert.Equal(t, "[\"hello\",\"goodbye\"]", stringifyOutput(arr))
|
|
assert.Equal(t, "{\"bar\":{\"baz\":true},\"foo\":42}", stringifyOutput(obj))
|
|
}
|