github.com/niko0xdev/gqlgen@v0.17.55-0.20240120102243-2ecff98c3e37/graphql/bool_test.go (about)

     1  package graphql
     2  
     3  import (
     4  	"bytes"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  func TestBoolean(t *testing.T) {
    11  	assert.Equal(t, "true", doBooleanMarshal(true))
    12  	assert.Equal(t, "false", doBooleanMarshal(false))
    13  }
    14  
    15  func doBooleanMarshal(b bool) string {
    16  	var buf bytes.Buffer
    17  	MarshalBoolean(b).MarshalGQL(&buf)
    18  	return buf.String()
    19  }