Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Grafcube committed Mar 6, 2023
1 parent 506c15c commit a361c36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
variant: ${{ matrix.racket-variant }}
version: ${{ matrix.racket-version }}
- name: Installing string-interpolation and its dependencies
run: raco pkg install --no-docs --auto --name string-interpolation
run: raco pkg install --auto --name string-interpolation
- name: Compiling string-interpolation and building its docs
run: raco setup --check-pkg-deps --unused-pkg-deps string-interpolation
- name: Testing string-interpolation
Expand Down
2 changes: 1 addition & 1 deletion info.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(define deps '("base"))
(define build-deps '("scribble-lib" "racket-doc" "rackunit-lib"))
(define scribblings '(("scribblings/string-interpolation.scrbl" ())))
(define pkg-desc "String interpolation macro")
(define pkg-desc "String interpolation syntax in string literals")
(define version "1.0")
(define pkg-authors '(Grafcube))
(define license '(Apache-2.0 OR MIT))
6 changes: 6 additions & 0 deletions main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@
(to-stx `(,#'format ,template ,@values)))))

(provide #%datum)

(module+ test
(require rackunit)
(define answer 42)
(check-equal? "What's the answer? 42" "What's the answer? @{answer}")
(check-equal? "4 + 2 = 6" "4 + 2 = @{(+ 4 2)}"))

0 comments on commit a361c36

Please sign in to comment.