Expose internal RawBool type

This commit is contained in:
go-jet 2023-04-17 12:46:11 +02:00
parent a428981a2d
commit 0a7e0b5392
7 changed files with 17 additions and 0 deletions

View file

@ -82,6 +82,7 @@ type RawArgs = map[string]interface{}
var (
Raw = jet.Raw
RawBool = jet.RawBool
RawInt = jet.RawInt
RawFloat = jet.RawFloat
RawString = jet.RawString

View file

@ -45,6 +45,9 @@ func TestRawInvalidArguments(t *testing.T) {
}
func TestRawType(t *testing.T) {
assertSerialize(t, RawBool("table.colInt < :float", RawArgs{":float": 11.22}).IS_FALSE(),
"(table.colInt < ?) IS FALSE", 11.22)
assertSerialize(t, RawFloat("table.colInt + &float", RawArgs{"&float": 11.22}).EQ(Float(3.14)),
"((table.colInt + ?) = ?)", 11.22, 3.14)
assertSerialize(t, RawString("table.colStr || str", RawArgs{"str": "doe"}).EQ(String("john doe")),