github.com/TIBCOSoftware/flogo-lib@v0.5.9/core/mapper/exprmapper/function/string/equals/equals_test.go (about)

     1  package equals
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  
     7  	"github.com/TIBCOSoftware/flogo-lib/core/mapper/exprmapper/expression"
     8  	"github.com/stretchr/testify/assert"
     9  )
    10  
    11  var s = &Equals{}
    12  
    13  func TestStaticFunc_Starts_with(t *testing.T) {
    14  	final1 := s.Eval("TIBCO FLOGO", "TIBCO")
    15  	fmt.Println(final1)
    16  	assert.Equal(t, false, final1)
    17  
    18  	final2 := s.Eval("TIBCO", "tibco")
    19  	fmt.Println(final2)
    20  	assert.Equal(t, false, final2)
    21  
    22  }
    23  
    24  func TestExpression(t *testing.T) {
    25  	fun, err := expression.ParseExpression(`string.equals("TIBCO FLOGO", "TIBCO FLOGO")`)
    26  	assert.Nil(t, err)
    27  	assert.NotNil(t, fun)
    28  	v, err := fun.Eval()
    29  	assert.Nil(t, err)
    30  	assert.NotNil(t, v)
    31  	assert.Equal(t, true, v)
    32  }