a291c8690a
GitOrigin-RevId: e6e19f3d81a982a62e1bba08f0b4f7fdc21b4ea0
31 lines
602 B
Nix
31 lines
602 B
Nix
{ depot, ... }:
|
|
|
|
let
|
|
inherit (depot.nix.runTestsuite)
|
|
it
|
|
assertEq
|
|
runTestsuite
|
|
;
|
|
|
|
inherit (depot.users.sterni.nix)
|
|
char
|
|
string
|
|
int
|
|
fun
|
|
;
|
|
|
|
charList = string.toChars char.allChars;
|
|
|
|
testAllCharConversion = it "tests conversion of all chars" [
|
|
(assertEq "char.chr converts to char.allChars"
|
|
(builtins.genList (fun.rl char.chr (int.add 1)) 255)
|
|
charList)
|
|
(assertEq "char.ord converts from char.allChars"
|
|
(builtins.genList (int.add 1) 255)
|
|
(builtins.map char.ord charList))
|
|
];
|
|
|
|
in
|
|
runTestsuite "char" [
|
|
testAllCharConversion
|
|
]
|