diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cc9c505 --- /dev/null +++ b/.github/workflows/test.yml @@ -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/checkout@v3.1.0 + - uses: Bogdanp/setup-racket@v1.9.1 + 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 diff --git a/eval-bot/eval.rkt b/eval-bot/eval.rkt index a3c29fb..af39117 100644 --- a/eval-bot/eval.rkt +++ b/eval-bot/eval.rkt @@ -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" ""))))