From 05727bfc3a9cfd45a8e2028dfd0806f7a8f88015 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 20 Feb 2021 17:53:40 +0100 Subject: =?UTF-8?q?Reorganize=20tests=20=F0=9F=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/typ/expr/call.typ | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/typ/expr/call.typ (limited to 'tests/typ/expr/call.typ') diff --git a/tests/typ/expr/call.typ b/tests/typ/expr/call.typ new file mode 100644 index 00000000..213d5554 --- /dev/null +++ b/tests/typ/expr/call.typ @@ -0,0 +1,40 @@ +// Test function calls. + +--- +// One argument. +#args(bold) + +// One argument and trailing comma. +#args(1,) + +// One named argument. +#args(a:2) + +// Mixed arguments. +{args(1, b: "2", 3)} + +--- +// Different forms of template arguments. +// Ref: true + +#let a = "a" + +#args[a] \ +#args(a) \ +#args(a, [b]) \ +#args(a)[b] \ + +// Template can be argument or body depending on whitespace. +#if "template" == type[b] [Sure ] +#if "template" == type [Nope.] #else [thing.] + +// Should output ` (Okay.)`. +#args (Okay.) + +--- +// Call function assigned to variable. +#let alias = type +#test(alias(alias), "function") + +// Library function `font` returns template. +#test(type(font(12pt)), "template") -- cgit v1.2.3