Skip to content

feat: using $paste in Testing.ark to stop recursive macro evaluation #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
branches: [ master ]

env:
ARTIFACT_NAME: "linux-clang-15.zip"
CLANG_VERSION: 15
ARTIFACT_NAME: "linux-clang-16.zip"
CLANG_VERSION: 16

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout std
Expand Down Expand Up @@ -43,4 +43,5 @@ jobs:
shell: bash
run: |
./arkscript --version
mkdir -p std && mv *.ark std/
./arkscript tests/all.ark -L ./
14 changes: 7 additions & 7 deletions Testing.ark
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@
# =end
# @author https://github.com/SuperFola
($ test:expect (_cond ..._desc) {
(if (!= true _cond)
(_report_error true _cond "true" ($repr _cond) _desc)
(if (!= true ($paste _cond))
(_report_error true ($paste _cond) "true" ($repr _cond) _desc)
(_report_success))})

# @brief Compare two values that should be equal and generate a test case
Expand All @@ -154,9 +154,9 @@
# =end
# @author https://github.com/SuperFola
($ test:eq (_expected _expr ..._desc) {
(if (= _expected _expr)
(if (= ($paste _expected) ($paste _expr))
(_report_success)
(_report_error _expected _expr ($repr _expected) ($repr _expr) _desc))})
(_report_error ($paste _expected) ($paste _expr) ($repr _expected) ($repr _expr) _desc))})

# @brief Compare two values that should **not** be equal and generate a test case
# @param _unexpected the value we don't want
Expand All @@ -168,9 +168,9 @@
# =end
# @author https://github.com/SuperFola
($ test:neq (_unexpected _value ..._desc) {
(if (!= _unexpected _value)
(if (!= ($paste _unexpected) ($paste _value))
(_report_success)
(_report_error _unexpected _value ($repr _unexpected) ($repr _value) _desc))})
(_report_error ($paste _unexpected) ($paste _value) ($repr _unexpected) ($repr _value) _desc))})

# @brief Generate the code for a test suite
# @details Create two variables: _name-output (a list: [successes, failures]) and _name-status (boolean, true on success)
Expand All @@ -184,5 +184,5 @@
# =end
# @author https://github.com/SuperFola
($ test:suite (_name _body) {
(let (symcat _name "-output") (_runner ($repr _name) (fun () {_body})))
(let (symcat _name "-output") (_runner ($repr _name) (fun () ($paste {_body}))))
(let (symcat _name "-status") (= 0 (@ (symcat _name "-output") 1)))})