Skip to content

Commit

Permalink
pkg/regexp: delete duplicate test case in txtar
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Jolly <[email protected]>
Change-Id: Ia61685e57a0c3512c0517f17dfd7a857b2760a67
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/532811
Unity-Result: CUEcueckoo <[email protected]>
Reviewed-by: Marcel van Lohuizen <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
myitcv committed Feb 8, 2022
1 parent 8a2e832 commit fe20132
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions pkg/regexp/testdata/gen.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,42 @@ import "regexp"
t1: regexp.Find(#"f\w\w"#, "afoot")
t2: regexp.Find(#"f\w\w"#, "bar")
t3: regexp.FindAll(#"f\w\w"#, "afoot afloat from", 2)
t4: regexp.FindAll(#"f\w\w"#, "afoot afloat from", 2)
t5: regexp.FindAll(#"f\w\w"#, "bla bla", -1)
t6: regexp.FindSubmatch(#"f(\w)(\w)"#, "afloat afoot from")
t7: regexp.FindAllSubmatch(#"f(\w)(\w)"#, "afloat afoot from", -1)
t8: regexp.FindAllSubmatch(#"f(\w)(\w)"#, "aglom", -1)
t9: regexp.FindNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "afloat afoot from")
t10: regexp.FindAllNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "afloat afoot from", -1)
t11: regexp.FindAllNamedSubmatch(#"f(?P<A>optional)?"#, "fbla", -1)
t12: regexp.FindAllNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "aglom", -1)
t13: regexp.Valid & "valid"
t14: regexp.Valid & "invalid)"
t4: regexp.FindAll(#"f\w\w"#, "bla bla", -1)
t5: regexp.FindSubmatch(#"f(\w)(\w)"#, "afloat afoot from")
t6: regexp.FindAllSubmatch(#"f(\w)(\w)"#, "afloat afoot from", -1)
t7: regexp.FindAllSubmatch(#"f(\w)(\w)"#, "aglom", -1)
t8: regexp.FindNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "afloat afoot from")
t9: regexp.FindAllNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "afloat afoot from", -1)
t10: regexp.FindAllNamedSubmatch(#"f(?P<A>optional)?"#, "fbla", -1)
t11: regexp.FindAllNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "aglom", -1)
t12: regexp.Valid & "valid"
t13: regexp.Valid & "invalid)"
-- out/regexp --
Errors:
t14: invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`:
./in.cue:16:21
t13: invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`:
./in.cue:15:21
error in call to regexp.Find: no match:
./in.cue:4:5
error in call to regexp.FindAll: no match:
./in.cue:7:5
./in.cue:6:5
error in call to regexp.FindAllSubmatch: no match:
./in.cue:10:5
./in.cue:9:5
error in call to regexp.FindAllNamedSubmatch: no match:
./in.cue:14:6
./in.cue:13:6

Result:
t1: "foo"
t2: _|_ // error in call to regexp.Find: no match
t3: ["foo", "flo"]
t4: ["foo", "flo"]
t5: _|_ // error in call to regexp.FindAll: no match
t6: ["flo", "l", "o"]
t7: [["flo", "l", "o"], ["foo", "o", "o"], ["fro", "r", "o"]]
t8: _|_ // error in call to regexp.FindAllSubmatch: no match
t9: {
t4: _|_ // error in call to regexp.FindAll: no match
t5: ["flo", "l", "o"]
t6: [["flo", "l", "o"], ["foo", "o", "o"], ["fro", "r", "o"]]
t7: _|_ // error in call to regexp.FindAllSubmatch: no match
t8: {
A: "l"
B: "o"
}
t10: [{
t9: [{
A: "l"
B: "o"
}, {
Expand All @@ -53,10 +51,10 @@ t10: [{
A: "r"
B: "o"
}]
t11: [{
t10: [{
A: ""
}]
t12: _|_ // error in call to regexp.FindAllNamedSubmatch: no match
t13: "valid"
t14: _|_ // t14: invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`
t11: _|_ // error in call to regexp.FindAllNamedSubmatch: no match
t12: "valid"
t13: _|_ // t13: invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`

0 comments on commit fe20132

Please sign in to comment.