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

     1  package expressions_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/lmorg/murex/test"
     7  )
     8  
     9  func TestParseFunction(t *testing.T) {
    10  	tests := []test.MurexTest{
    11  		{
    12  			Block:  `out(hello world)`,
    13  			Stdout: "hello world",
    14  		},
    15  		{
    16  			Block:  `out("hello" 'world')`,
    17  			Stdout: "hello world",
    18  		},
    19  		{
    20  			Block:  `out(%(hello) %(world))`,
    21  			Stdout: "hello world",
    22  		},
    23  		{
    24  			Block:  `out({hello}{world})`,
    25  			Stdout: "{hello}{world}",
    26  		},
    27  		{
    28  			Block:  `if({true}{out hello}{out world})`,
    29  			Stdout: "hello",
    30  		},
    31  		{
    32  			Block:  `out(%({hello}{world}))`,
    33  			Stdout: "{hello}{world}",
    34  		},
    35  	}
    36  
    37  	test.RunMurexTests(tests, t)
    38  }