summary refs log tree commit diff
path: root/lib/tests.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tests.nix')
-rw-r--r--lib/tests.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/tests.nix b/lib/tests.nix
index b5513dcb5ff..d59814987ed 100644
--- a/lib/tests.nix
+++ b/lib/tests.nix
@@ -181,4 +181,27 @@ runTests {
     '';
   };
 
+  /* right now only invocation check */
+  testToJSONSimple =
+    let val = {
+      foobar = [ "baz" 1 2 3 ];
+    };
+    in {
+      expr = generators.toJSON {} val;
+      # trival implementation
+      expected = builtins.toJSON val;
+  };
+
+  /* right now only invocation check */
+  testToYAMLSimple =
+    let val = {
+      list = [ { one = 1; } { two = 2; } ];
+      all = 42;
+    };
+    in {
+      expr = generators.toYAML {} val;
+      # trival implementation
+      expected = builtins.toJSON val;
+  };
+
 }