blob: 489ed6881fcc332972b3b3c01bb757a757cfce7c [file] [log] [blame]
# DO NOT EDIT; generated by go run testdata/gen.go
#
#name: regexp
#evalPartial
-- in.cue --
c1: "a" =~ "a"
c2: "foo" =~ "[a-z]{3}"
c3: "foo" =~ "[a-z]{4}"
c4: "foo" !~ "[a-z]{4}"
b1: =~"a"
b1: "a"
b2: =~"[a-z]{3}"
b2: "foo"
b3: =~"[a-z]{4}"
b3: "foo"
b4: !~"[a-z]{4}"
b4: "foo"
s1: !="b" & =~"c" // =~"c"
s2: !="b" & =~"[a-z]" // != "b" & =~"[a-z]"
e1: "foo" =~ 1
e2: "foo" !~ true
e3: !="a" & <5
-- out/def --
c1: true
c2: true
c3: false
c4: true
b1: "a"
b2: "foo"
b3: _|_ // invalid value "foo" (does not match =~"[a-z]{4}")
b4: "foo"
s1: =~"c"
s2: !="b" & =~"[a-z]"
e1: _|_ // invalid operation "foo" =~ 1 (mismatched types string and int)
e2: _|_ // invalid operation "foo" !~ true (mismatched types string and bool)
e3: _|_ // conflicting values !="a" and <5 (mismatched types string and number)
-- out/legacy-debug --
<0>{c1: true, c2: true, c3: false, c4: true, b1: "a", b2: "foo", b3: _|_((=~"[a-z]{4}" & "foo"):invalid value "foo" (does not match =~"[a-z]{4}")), b4: "foo", s1: =~"c", s2: (!="b" & =~"[a-z]"), e1: _|_(("foo" =~ 1):invalid operation "foo" =~ 1 (mismatched types string and int)), e2: _|_(("foo" !~ true):invalid operation "foo" !~ true (mismatched types string and bool)), e3: _|_((!="a" & <5):conflicting values !="a" and <5 (mismatched types string and number))}
-- out/compile --
--- in.cue
{
c1: ("a" =~ "a")
c2: ("foo" =~ "[a-z]{3}")
c3: ("foo" =~ "[a-z]{4}")
c4: ("foo" !~ "[a-z]{4}")
b1: =~"a"
b1: "a"
b2: =~"[a-z]{3}"
b2: "foo"
b3: =~"[a-z]{4}"
b3: "foo"
b4: !~"[a-z]{4}"
b4: "foo"
s1: (!="b" & =~"c")
s2: (!="b" & =~"[a-z]")
e1: ("foo" =~ 1)
e2: ("foo" !~ true)
e3: (!="a" & <5)
}
-- out/eval --
Errors:
e3: invalid value <5 (mismatched types number and string)
b3: invalid value "foo" (out of bound =~"[a-z]{4}"):
./in.cue:10:5
e1: cannot use 1 (type int) as type (string|bytes):
./in.cue:18:5
e2: cannot use true (type bool) as type (string|bytes):
./in.cue:19:5
Result:
(_|_){
// [eval]
c1: (bool){ true }
c2: (bool){ true }
c3: (bool){ false }
c4: (bool){ true }
b1: (string){ "a" }
b2: (string){ "foo" }
b3: (_|_){
// [eval] b3: invalid value "foo" (out of bound =~"[a-z]{4}"):
// ./in.cue:10:5
}
b4: (string){ "foo" }
s1: (string){ &(!="b", =~"c") }
s2: (string){ &(!="b", =~"[a-z]") }
e1: (_|_){
// [eval] e1: cannot use 1 (type int) as type (string|bytes):
// ./in.cue:18:5
}
e2: (_|_){
// [eval] e2: cannot use true (type bool) as type (string|bytes):
// ./in.cue:19:5
}
e3: (_|_){
// [eval] e3: invalid value <5 (mismatched types number and string)
}
}