Skip to content

Commit

Permalink
Merge pull request #39 from ArkScript-lang/feat/stop-macro-evaluation
Browse files Browse the repository at this point in the history
feat: using $paste in Testing.ark to stop recursive macro evaluation
  • Loading branch information
SuperFola authored Jul 12, 2024
2 parents aae15fe + a650c8e commit 9ec80d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
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)))})

0 comments on commit 9ec80d6

Please sign in to comment.