about summary refs log tree commit diff
path: root/nix/yants/tests
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-01-30T16·06+0300
committertazjin <tazjin@tvl.su>2022-01-31T16·11+0000
commitaa122cbae78ce97d60c0c98ba14df753d97e40b1 (patch)
tree12b98d85c4b18fe870feb26de70db9ba61837bd7 /nix/yants/tests
parent2d10d60fac0fd00a71b65cfdcb9fba0477b2086c (diff)
style: format entire depot with nixpkgs-fmt r/3723
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>
Diffstat (limited to 'nix/yants/tests')
-rw-r--r--nix/yants/tests/default.nix34
1 files changed, 18 insertions, 16 deletions
diff --git a/nix/yants/tests/default.nix b/nix/yants/tests/default.nix
index 9a0b2403e124..0c7ec2418802 100644
--- a/nix/yants/tests/default.nix
+++ b/nix/yants/tests/default.nix
@@ -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
+]