From 41c0e26f48c80835afe962c8c6a64d4cc7c18b13 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sat, 2 May 2020 14:39:51 -0400 Subject: fixed including something multiple times --- tests/include.toc | 16 ++++++++++++++++ tests/include_expected | 7 +++++++ tests/included.toc | 5 +++++ tests/test.sh | 1 + 4 files changed, 29 insertions(+) create mode 100644 tests/include.toc create mode 100644 tests/include_expected create mode 100644 tests/included.toc (limited to 'tests') diff --git a/tests/include.toc b/tests/include.toc new file mode 100644 index 0000000..dee6c16 --- /dev/null +++ b/tests/include.toc @@ -0,0 +1,16 @@ +#include "std/io.toc", io; +#include "std/io.toc", foo; +#include "std/io.toc", bar; +#include "std/io.toc", baz; +#include "std/io.toc"; +#include "included.toc", inc; + +main ::= fn() { + puts("hello"); + io.puts("hello"); + foo.puts("hello"); + bar.puts("hello"); + baz.puts("hello"); + inc.puts("hello"); + inc.foo.puts("hello"); +} diff --git a/tests/include_expected b/tests/include_expected new file mode 100644 index 0000000..5b04198 --- /dev/null +++ b/tests/include_expected @@ -0,0 +1,7 @@ +hello +hello +hello +hello +hello +hello +hello diff --git a/tests/included.toc b/tests/included.toc new file mode 100644 index 0000000..548a3e5 --- /dev/null +++ b/tests/included.toc @@ -0,0 +1,5 @@ +// included by include.toc + +#include "std/io.toc"; +#include "std/io.toc", foo; + diff --git a/tests/test.sh b/tests/test.sh index bf58042..1d01f06 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -3,6 +3,7 @@ tests='bf control_flow types +include arrs_slices ptr_arithmetic defer -- cgit v1.2.3