github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/utils/mxjson/mxvalid_test.go (about)

     1  package mxjson_test
     2  
     3  import "testing"
     4  
     5  func TestQuoteBrace(t *testing.T) {
     6  	tests := []testCase{
     7  		{
     8  			Json:     `{"foo": ({foobar}) }`,
     9  			Expected: `{"foo":"{foobar}"}`,
    10  		},
    11  		{
    12  			Json:     `{"foo": ({true}) }`,
    13  			Expected: `{"foo":"{true}"}`,
    14  		},
    15  		{
    16  			Json:     `{"foo": ({false}) }`,
    17  			Expected: `{"foo":"{false}"}`,
    18  		},
    19  		{
    20  			Json:     `{"foo": ({1}) }`,
    21  			Expected: `{"foo":"{1}"}`,
    22  		},
    23  		{
    24  			Json:     `{"foo": ({1.3}) }`,
    25  			Expected: `{"foo":"{1.3}"}`,
    26  		},
    27  		{
    28  			Json:     `{"foo": ({1 2 3}) }`,
    29  			Expected: `{"foo":"{1 2 3}"}`,
    30  		},
    31  		{
    32  			Json:     `{"foo": ({@[foobar]}) }`,
    33  			Expected: `{"foo":"{@[foobar]}"}`,
    34  		},
    35  	}
    36  
    37  	runTestCases(t, tests)
    38  }