oxedyne/fe2o3/fe2o3_austenite/tests/fixtures/eval/general/strings_arrays.typ
1.3 KiB, 1 run
created by r1870400018:63896, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | // The string, array and dictionary library. |
| 2 | #let s = "Hello, World" |
| 3 | #metadata((s.len(), s.first(), s.last(), s.at(4), s.slice(0, 5), s.contains("World"), s.starts-with("He"), s.ends-with("ld"))) <probe> |
| 4 | #metadata((s.find("o"), s.position("o"), s.replace("o", "0"), s.split(", "), s.trim("H"), upper(s), lower(s), s.rev())) <probe> |
| 5 | #metadata(("a,b,,c".split(","), " pad ".trim(), "x" * 3, "abc".clusters(), "é".codepoints(), str(42), str(1.5), str(0x1F), int("12"), float("2.5"))) <probe> |
| 6 | #let arr = (3, 1, 4, 1, 5, 9, 2, 6) |
| 7 | #metadata((arr.len(), arr.first(), arr.last(), arr.sorted(), arr.dedup(), arr.rev(), arr.slice(2, 5), arr.contains(9), arr.find(x => x > 3), arr.position(x => x == 5))) <probe> |
| 8 | #metadata((arr.sum(), arr.product(), calc.max(..arr), calc.min(..arr), arr.map(x => x * 2), arr.enumerate().slice(0, 2), arr.zip(range(8)).slice(0, 2), arr.map(str).join(), (("a", "b").join(", ")), arr.chunks(3), arr.windows(7).len())) <probe> |
| 9 | #let d = (name: "Ada", year: 1815) |
| 10 | #metadata((d.keys(), d.values(), d.pairs(), d.at("name"), d.at("x", default: 0), d.len(), d.name)) <probe> |
| 11 | #let d2 = d |
| 12 | #{ d2.insert("field", "maths"); d2.remove("year") } |
| 13 | #metadata((d2, d)) <probe> |
| 14 | #metadata((("b", "a", "c").sorted(key: x => x), ((1, "z"), (0, "y")).sorted(key: p => p.at(0)))) <probe> |