From f8a84cac9ad03d7d9aae186cc1c69dba8bc9f2b5 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 9 Jul 2019 19:31:21 +0200 Subject: [PATCH] revert and test --- tests/import/test.log | 42 +++++++++++++++++++++++++++++++++ tests/tree/array_cast.gw | 2 ++ tests/tree/did_you_mean_type.gw | 4 ++++ tests/tree/push_func.gw | 1 + tests/tree/reddit.gw | 8 +++++++ tests/tree/template_fptr.gw | 11 +++++++++ 6 files changed, 68 insertions(+) create mode 100644 tests/tree/array_cast.gw create mode 100644 tests/tree/did_you_mean_type.gw create mode 100644 tests/tree/push_func.gw create mode 100644 tests/tree/reddit.gw create mode 100644 tests/tree/template_fptr.gw diff --git a/tests/import/test.log b/tests/import/test.log index b584940e..8557b3a4 100644 --- a/tests/import/test.log +++ b/tests/import/test.log @@ -11398,3 +11398,45 @@ global_func.gw ==22565== Memcheck, a memory error detector ==4349== ==4349== For counts of detected and suppressed errors, rerun with: -v ==4349== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +/dev/null ==13821== Memcheck, a memory error detector +==13821== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. +==13821== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info +==13821== Command: ./../../gwion -p. -d dummy /dev/null +==13821== Parent PID: 13795 +==13821== +==13821== +==13821== HEAP SUMMARY: +==13821== in use at exit: 928 bytes in 10 blocks +==13821== total heap usage: 974 allocs, 964 frees, 7,596,796 bytes allocated +==13821== +==13821== LEAK SUMMARY: +==13821== definitely lost: 928 bytes in 10 blocks +==13821== indirectly lost: 0 bytes in 0 blocks +==13821== possibly lost: 0 bytes in 0 blocks +==13821== still reachable: 0 bytes in 0 blocks +==13821== suppressed: 0 bytes in 0 blocks +==13821== Rerun with --leak-check=full to see details of leaked memory +==13821== +==13821== For counts of detected and suppressed errors, rerun with: -v +==13821== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +/dev/null ==14729== Memcheck, a memory error detector +==14729== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. +==14729== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info +==14729== Command: ./../../gwion -p. -d dummy /dev/null +==14729== Parent PID: 13795 +==14729== +==14729== +==14729== HEAP SUMMARY: +==14729== in use at exit: 576 bytes in 9 blocks +==14729== total heap usage: 956 allocs, 947 frees, 7,590,612 bytes allocated +==14729== +==14729== LEAK SUMMARY: +==14729== definitely lost: 576 bytes in 9 blocks +==14729== indirectly lost: 0 bytes in 0 blocks +==14729== possibly lost: 0 bytes in 0 blocks +==14729== still reachable: 0 bytes in 0 blocks +==14729== suppressed: 0 bytes in 0 blocks +==14729== Rerun with --leak-check=full to see details of leaked memory +==14729== +==14729== For counts of detected and suppressed errors, rerun with: -v +==14729== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/tests/tree/array_cast.gw b/tests/tree/array_cast.gw new file mode 100644 index 00000000..1b7c437c --- /dev/null +++ b/tests/tree/array_cast.gw @@ -0,0 +1,2 @@ +typedef int[2] _int; +new _int $ _int; diff --git a/tests/tree/did_you_mean_type.gw b/tests/tree/did_you_mean_type.gw new file mode 100644 index 00000000..73b04597 --- /dev/null +++ b/tests/tree/did_you_mean_type.gw @@ -0,0 +1,4 @@ +class C { + <<>>; + int a; +} diff --git a/tests/tree/push_func.gw b/tests/tree/push_func.gw new file mode 100644 index 00000000..2f7957f6 --- /dev/null +++ b/tests/tree/push_func.gw @@ -0,0 +1 @@ +me.exit; diff --git a/tests/tree/reddit.gw b/tests/tree/reddit.gw new file mode 100644 index 00000000..9b4fd259 --- /dev/null +++ b/tests/tree/reddit.gw @@ -0,0 +1,8 @@ + +#! basic math printed out (note the space after '<<<' and before '>>>' +<<< 1 + 2 >>>; + +#! define and operator +operator $@+-*%~<>^&!= void (int i, int j) { <<< i, " ", j >>>; } + +1 $@+-*%~<>^&!= 2; diff --git a/tests/tree/template_fptr.gw b/tests/tree/template_fptr.gw new file mode 100644 index 00000000..3a130d9f --- /dev/null +++ b/tests/tree/template_fptr.gw @@ -0,0 +1,11 @@ +typedef int ptr_t<~A~>(A); +ptr_t ptr; +<<>>; + +fun int test<~A~>(A a) { <<< a >>>; } +test @=> ptr; +<<< ptr >>>; +#!3; +#!3 => test; +ptr<~int~>(2); +ptr<~float~>(2.3); -- 2.43.0