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

     1  package functions
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/lmorg/murex/test/count"
     7  )
     8  
     9  func TestFunctionsBitwise(t *testing.T) {
    10  	count.Tests(t, 2)
    11  
    12  	fn := new(FunctionT)
    13  	fn.Properties = P_NEW_CHAIN | P_PIPE_OUT | P_LOGIC_AND
    14  
    15  	if !fn.Properties.NewChain() || fn.Properties.Method() ||
    16  		!fn.Properties.PipeOut() || fn.Properties.PipeErr() ||
    17  		!fn.Properties.LogicAnd() || fn.Properties.LogicOr() {
    18  		t.Error("test 0 failed")
    19  	}
    20  
    21  	fn.Properties = 0
    22  	fn.Properties = P_METHOD | P_PIPE_ERR | P_LOGIC_OR
    23  
    24  	if fn.Properties.NewChain() || !fn.Properties.Method() ||
    25  		fn.Properties.PipeOut() || !fn.Properties.PipeErr() ||
    26  		fn.Properties.LogicAnd() || !fn.Properties.LogicOr() {
    27  		t.Error("test 1 failed")
    28  	}
    29  }