Define examples in the "examples" field instead of "example"

Only examples defined in the "examples" field are generated, if they are
defined in "example", they are just ignored.

Also fix a bunch of incorrect tests.
This commit is contained in:
Emanuele Torre authored and Nico Williams committed 2023-07-18 12:12:50 -05:00
1 parent 01dfd8b86d
commit 15fd31de78
4 files changed
+127 -16

No files matched your search

+32
View File
@@ -42,3 +42,35 @@ capture("(?<a>[a-z]+)-(?<n>[0-9]+)")
"xyzzy-14"
{ "a": "xyzzy", "n": "14" }
scan("c")
"abcdefabc"
"c"
"c"
split(", *"; null)
"ab,cd, ef"
["ab","cd","ef"]
splits(", *")
"ab,cd, ef, gh"
"ab"
"cd"
"ef"
"gh"
sub("[^a-z]*(?<x>[a-z]+)"; "Z\(.x)"; "g")
"123abc456def"
"ZabcZdef"
[sub("(?<a>.)"; "\(.a|ascii_upcase)", "\(.a|ascii_downcase)")]
"aB"
["AB","aB"]
gsub("(?<x>.)[^a]*"; "+\(.x)-")
"Abcabc"
"+A-+a-"
[gsub("p"; "a", "b")]
"p"
["a","b"]