diff options
author | Eduardo Julian | 2017-01-04 23:06:04 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-01-04 23:06:04 -0400 |
commit | 069f66e0746488c9d2e3c26f14a09b5d416e456f (patch) | |
tree | 56a3c5efefeff0b12edf27880741b60f9e89de0c /stdlib/test | |
parent | 8343ca14bdc6ec29070021cb6d8ef05e0a234fb6 (diff) |
- Moved the template: macro to the lux module.
Diffstat (limited to '')
-rw-r--r-- | stdlib/test/test/lux.lux | 10 | ||||
-rw-r--r-- | stdlib/test/test/lux/macro/template.lux | 27 | ||||
-rw-r--r-- | stdlib/test/tests.lux | 9 |
3 files changed, 14 insertions, 32 deletions
diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux index 1085a1376..5b530ba98 100644 --- a/stdlib/test/test/lux.lux +++ b/stdlib/test/test/lux.lux @@ -172,3 +172,13 @@ (is "lol" (default "yolo" (#;Some "lol"))))) )) + +(template: (hypotenuse x y) + (i.+ (i.* x x) (i.* y y))) + +(test: "Templates" + [x R;int + y R;int] + (assert "Template application is a stand-in for the templated code." + (i.= (i.+ (i.* x x) (i.* y y)) + (hypotenuse x y)))) diff --git a/stdlib/test/test/lux/macro/template.lux b/stdlib/test/test/lux/macro/template.lux deleted file mode 100644 index 4ff5e683f..000000000 --- a/stdlib/test/test/lux/macro/template.lux +++ /dev/null @@ -1,27 +0,0 @@ -## Copyright (c) Eduardo Julian. All rights reserved. -## This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -## If a copy of the MPL was not distributed with this file, -## You can obtain one at http://mozilla.org/MPL/2.0/. - -(;module: - lux - (lux (codata [io]) - (control monad) - (data text/format - [error #- fail]) - (math ["R" random]) - pipe - [compiler] - (macro ["s" syntax] - ["&" template #+ template:])) - lux/test) - -(template: (hypotenuse x y) - (i.+ (i.* x x) (i.* y y))) - -(test: "Templates" - [x R;int - y R;int] - (assert "Template application is a stand-in for the templated code." - (i.= (i.+ (i.* x x) (i.* y y)) - (hypotenuse x y)))) diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux index 9e7c1c246..c57ca61c5 100644 --- a/stdlib/test/tests.lux +++ b/stdlib/test/tests.lux @@ -48,19 +48,18 @@ [set] [stack] [tree] - [vector] + ## [vector] [zipper]) - (text [format])) + (text [format]) + ) ["_;" math] (math ["_;" ratio] ["_;" complex] ## ["_;" random] - ["_;" simple] - ) + ["_;" simple]) ## ["_;" macro] (macro ["_;" ast] ["_;" syntax] - ["_;" template] (poly ["poly_;" eq] ["poly_;" text-encoder] ["poly_;" functor])) |