Skip to content
Myr

manonig.test

This file

Path

tests/manonig.test

89 lines · 1.7 KiB

Last changed by

Refactor splits/2 using foreach syntax (remove private filter _nwise) (#3260)itchynybefore adoptionb088e83

History of this file

Take it

The walk stopped after 200 commits: lines older than fa6a2ff point at it.

website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff

lines 1–66why, one step back
1split(", ")
2"a, b,c,d, e, "3["a","b,c,d","e",""]45walk( if type == "object" then with_entries( .key |= sub( "^_+"; "") ) else . end )6[ { "_a": { "__b": 2 } } ]7[{"a":{"b":2}}]89test("foo")10"foo"11true1213.[] | test("a b c # spaces are ignored"; "ix")14["xabcd", "ABC"]15true16true1718match("(abc)+"; "g")19"abc abc"20{"offset": 0, "length": 3, "string": "abc", "captures": [{"offset": 0, "length": 3, "string": "abc", "name": null}]}21{"offset": 4, "length": 3, "string": "abc", "captures": [{"offset": 4, "length": 3, "string": "abc", "name": null}]}2223match("foo")24"foo bar foo"25{"offset": 0, "length": 3, "string": "foo", "captures": []}2627match(["foo", "ig"])28"foo bar FOO"29{"offset": 0, "length": 3, "string": "foo", "captures": []}30{"offset": 8, "length": 3, "string": "FOO", "captures": []}3132match("foo (?<bar123>bar)? foo"; "ig")33"foo bar foo foo foo"34{"offset": 0, "length": 11, "string": "foo bar foo", "captures": [{"offset": 4, "length": 3, "string": "bar", "name": "bar123"}]}35{"offset": 12, "length": 8, "string": "foo foo", "captures": [{"offset": -1, "length": 0, "string": null, "name": "bar123"}]}3637[ match("."; "g")] | length38"abc"3934041capture("(?<a>[a-z]+)-(?<n>[0-9]+)")42"xyzzy-14"43{ "a": "xyzzy", "n": "14" }4445scan("c")46"abcdefabc"47"c"48"c"4950scan("(a+)(b+)")51"abaabbaaabbb"52["a","b"]53["aa","bb"]54["aaa","bbb"]5556split(", *"; null)57"ab,cd, ef"58["ab","cd","ef"]5960splits(", *")61"ab,cd, ef, gh"62"ab"63"cd"64"ef"65"gh"66

Refactor splits/2 using foreach syntax (remove private filter _nwise) (#3260)itchynybefore adoptionb088e83

lines 67–73why, one step back
67splits(",? *"; "n")
68"ab,cd ef, gh"69"ab"70"cd"71"ef"72"gh"73

website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff

lines 74–89why, one step back
74sub("[^a-z]*(?<x>[a-z]+)"; "Z\(.x)"; "g")
75"123abc456def"76"ZabcZdef"7778[sub("(?<a>.)"; "\(.a|ascii_upcase)", "\(.a|ascii_downcase)")]79"aB"80["AB","aB"]8182gsub("(?<x>.)[^a]*"; "+\(.x)-")83"Abcabc"84"+A-+a-"8586[gsub("p"; "a", "b")]87"p"88["a","b"]89