Skip to content

Commit

Permalink
chore: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
yfzhe committed Jan 16, 2024
1 parent 8d714ad commit 7a07d81
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test
on: [push, pull_request]
jobs:
build:
name: "Test on Racket '${{ matrix.racket-version }}' (${{ matrix.racket-variant }})"
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
racket-version: ["stable", "current"]
racket-variant: ["CS"]
include:
- racket-version: current
experimental: true
steps:
- uses: actions/[email protected]
- uses: Bogdanp/[email protected]
with:
architecture: x64
distribution: full
variant: ${{ matrix.racket-variant }}
version: ${{ matrix.racket-version }}
- name: Installing telebot
run: raco pkg install --no-docs --auto --link telebot
- name: Testing telebot
run: raco test -x -p telebot
- name: Installing eval-bot
run: raco pkg install --no-docs --auto --link eval-bot
- name: Testing eval-bot
run: raco test -x -p eval-bot
8 changes: 8 additions & 0 deletions eval-bot/eval.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,11 @@
(kill-evaluator evaluator)))

;; TODO: call-with-evaluator?

(module+ test
(require rackunit)

(check-equal? (eval-code "(+ 1 2)")
'(("3" "" "")))
(check-equal? (eval-code "(define a 42) (display (/ a 2))")
'(("" "" "") ("" "21" ""))))

0 comments on commit 7a07d81

Please sign in to comment.