From c2f3556dc75ee09890c2cfc867cdb10df23accf6 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 26 Jan 2021 22:30:07 +0100 Subject: [PATCH] lib/tests: More functionTo tests --- lib/tests/modules.sh | 8 +++-- lib/tests/modules/functionTo.nix | 29 ------------------- lib/tests/modules/functionTo/list-order.nix | 25 ++++++++++++++++ .../modules/functionTo/merging-attrs.nix | 27 +++++++++++++++++ lib/tests/modules/functionTo/merging-list.nix | 24 +++++++++++++++ lib/tests/modules/functionTo/trivial.nix | 17 +++++++++++ lib/tests/modules/functionTo/wrong-type.nix | 18 ++++++++++++ 7 files changed, 117 insertions(+), 31 deletions(-) delete mode 100644 lib/tests/modules/functionTo.nix create mode 100644 lib/tests/modules/functionTo/list-order.nix create mode 100644 lib/tests/modules/functionTo/merging-attrs.nix create mode 100644 lib/tests/modules/functionTo/merging-list.nix create mode 100644 lib/tests/modules/functionTo/trivial.nix create mode 100644 lib/tests/modules/functionTo/wrong-type.nix diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index 2d3a696e980..f843d303e44 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -262,8 +262,12 @@ checkConfigOutput true config.value.mkbefore ./types-anything/mk-mods.nix checkConfigOutput 1 config.value.nested.foo ./types-anything/mk-mods.nix checkConfigOutput baz config.value.nested.bar.baz ./types-anything/mk-mods.nix -# Check the merge behaviour of the functionTo type. -checkConfigOutput "a b" config.result ./functionTo.nix +## types.functionTo +checkConfigOutput "input is input" config.result ./functionTo/trivial.nix +checkConfigOutput "a b" config.result ./functionTo/merging-list.nix +checkConfigError 'A definition for option .fun.\[function body\]. is not of type .string.. Definition values:\n- In .*wrong-type.nix' config.result ./functionTo/wrong-type.nix +checkConfigOutput "b a" config.result ./functionTo/list-order.nix +checkConfigOutput "a c" config.result ./functionTo/merging-attrs.nix cat <