github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/lang/expressions/exp13_test.go (about)

     1  package expressions
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestExpElvis(t *testing.T) {
     8  	tests := []expressionTestT{
     9  		{
    10  			Expression: `null ?: null`,
    11  			Expected:   nil,
    12  		},
    13  		{
    14  			Expression: `null ?: "null"`,
    15  			Expected:   "null",
    16  		},
    17  		{
    18  			Expression: `null ?: 3`,
    19  			Expected:   float64(3),
    20  		},
    21  		{
    22  			Expression: `null ?: "3"`,
    23  			Expected:   "3",
    24  		},
    25  		/*{
    26  			Expression: `null ?: %[1..3]`,
    27  			Expected:   []interface{}{1,2,3},
    28  		},*/
    29  	}
    30  
    31  	testExpression(t, tests, true)
    32  }