diff --git a/testing/it.nix b/testing/it.nix index 194b97b..c733c8f 100644 --- a/testing/it.nix +++ b/testing/it.nix @@ -1,5 +1,5 @@ msg: -{ actual, expected, asString ? false, asJSON ? false, removeDunders ? false, }: +{ actual, expected, asString ? false, asJSON ? false, removeDunders ? false, safeToPrint ? true }: let preProcess = v: if removeDunders then @@ -21,4 +21,5 @@ builtins.trace actual builtins.trace expected '' echo FAILED ${msg} + echo '${if safeToPrint then builtins.toJSON actual else ""}' '' diff --git a/testing/site.test.nix b/testing/site.test.nix index 734b7d5..b5d8c16 100644 --- a/testing/site.test.nix +++ b/testing/site.test.nix @@ -218,4 +218,21 @@ in with site; [ }; })) + (it "copies all the files" ({ + actual = copyTo "." { + page = "this is a page"; + subdir = { + page = "this page is in a subdir"; + link = ./src; + }; + }; + expected = '' + cp /nix/store/crirfz0n6f8dgl1si3x7pwyw7fqm0r8l-page ./page + mkdir -p ./subdir + cp -r /nix/store/q95cn7ccixzi9w22aic4bl0ykk40ka7v-src ./subdir/link + cp /nix/store/ic6fyy8wg8r4338a3m5kinmg11igxsyj-page ./subdir/page + + ''; + })) + ]