cuelang.org/go@v0.10.1/pkg/list/testdata/sort.txtar (about) 1 // Issue #616 2 -- in.cue -- 3 import "list" 4 5 t1: { 6 l: ["c", "b", "a"] 7 ls: list.Sort(l, list.Ascending) 8 il: list.IsSorted(l, list.Ascending) 9 ils: list.IsSorted(ls, list.Ascending) 10 } 11 12 t2: { 13 l: ["c", "b", "a"] 14 il: list.IsSorted(l, list.Ascending) 15 16 ls: list.Sort(l, list.Ascending) 17 ils: list.IsSorted(ls, list.Ascending) 18 } 19 20 t3: { 21 L: ["c", "b", "a", "e", "d"] 22 l: list.Take(L, 4) 23 il: list.IsSorted(l, list.Ascending) 24 25 ls: list.Sort(l, list.Ascending) 26 ils: list.IsSorted(ls, list.Ascending) 27 28 l2: l 29 l3: ls 30 } 31 -- out/list -- 32 t1: { 33 l: ["c", "b", "a"] 34 ls: ["a", "b", "c"] 35 il: false 36 ils: true 37 } 38 t2: { 39 l: ["c", "b", "a"] 40 il: false 41 ls: ["a", "b", "c"] 42 ils: true 43 } 44 t3: { 45 L: ["c", "b", "a", "e", "d"] 46 l: ["c", "b", "a", "e"] 47 il: false 48 ls: ["a", "b", "c", "e"] 49 ils: true 50 l2: ["c", "b", "a", "e"] 51 l3: ["a", "b", "c", "e"] 52 }