style: format entire depot with nixpkgs-fmt
This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: cynthia <cynthia@tvl.fyi> Reviewed-by: edef <edef@edef.eu> Reviewed-by: eta <tvl@eta.st> Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
2d10d60fac
commit
aa122cbae7
310 changed files with 7278 additions and 5490 deletions
|
@ -25,7 +25,7 @@ let
|
|||
};
|
||||
|
||||
testPrimitives = it "checks that all primitive types match" [
|
||||
(assertDoesNotThrow "unit type" (unit {}))
|
||||
(assertDoesNotThrow "unit type" (unit { }))
|
||||
(assertDoesNotThrow "int type" (int 15))
|
||||
(assertDoesNotThrow "bool type" (bool false))
|
||||
(assertDoesNotThrow "float type" (float 13.37))
|
||||
|
@ -44,7 +44,7 @@ let
|
|||
# Test that structures work as planned.
|
||||
person = struct "person" {
|
||||
name = string;
|
||||
age = int;
|
||||
age = int;
|
||||
|
||||
contact = option (struct {
|
||||
email = string;
|
||||
|
@ -55,7 +55,7 @@ let
|
|||
testStruct = it "checks that structures work as intended" [
|
||||
(assertDoesNotThrow "person struct" (person {
|
||||
name = "Brynhjulf";
|
||||
age = 42;
|
||||
age = 42;
|
||||
contact.email = "brynhjulf@yants.nix";
|
||||
}))
|
||||
];
|
||||
|
@ -70,7 +70,8 @@ let
|
|||
|
||||
testEnum = it "checks enum definitions and matching" [
|
||||
(assertEq "enum is matched correctly"
|
||||
"It is in fact red!" (colour.match "red" colourMatcher))
|
||||
"It is in fact red!"
|
||||
(colour.match "red" colourMatcher))
|
||||
(assertThrows "out of bounds enum fails"
|
||||
(colour.match "alpha" (colourMatcher // {
|
||||
alpha = "This should never happen";
|
||||
|
@ -97,7 +98,8 @@ let
|
|||
testSum = it "checks sum types definitions and matching" [
|
||||
(assertDoesNotThrow "creature sum type" some-human)
|
||||
(assertEq "sum type is matched correctly"
|
||||
"It's a human named Brynhjulf" (creature.match some-human {
|
||||
"It's a human named Brynhjulf"
|
||||
(creature.match some-human {
|
||||
human = v: "It's a human named ${v.name}";
|
||||
pet = v: "It's not supposed to be a pet!";
|
||||
})
|
||||
|
@ -106,7 +108,7 @@ let
|
|||
|
||||
# Test curried function definitions
|
||||
func = defun [ string int string ]
|
||||
(name: age: "${name} is ${toString age} years old");
|
||||
(name: age: "${name} is ${toString age} years old");
|
||||
|
||||
testFunctions = it "checks function definitions" [
|
||||
(assertDoesNotThrow "function application" (func "Brynhjulf" 42))
|
||||
|
@ -144,13 +146,13 @@ let
|
|||
];
|
||||
|
||||
in
|
||||
runTestsuite "yants" [
|
||||
testPrimitives
|
||||
testPoly
|
||||
testStruct
|
||||
testEnum
|
||||
testSum
|
||||
testFunctions
|
||||
testTypes
|
||||
testRestrict
|
||||
]
|
||||
runTestsuite "yants" [
|
||||
testPrimitives
|
||||
testPoly
|
||||
testStruct
|
||||
testEnum
|
||||
testSum
|
||||
testFunctions
|
||||
testTypes
|
||||
testRestrict
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue