Skip to content

Instantly share code, notes, and snippets.

@dyoo
Last active December 16, 2015 04:49
Show Gist options
  • Save dyoo/5380369 to your computer and use it in GitHub Desktop.
Save dyoo/5380369 to your computer and use it in GitHub Desktop.
#lang racket
(define-syntax (verify stx)
(syntax-case stx ()
[(_ exp1 exp2)
(with-syntax ([the-line-number (syntax-line stx)])
(syntax/loc stx
(begin
(printf "~s == ~s : " 'exp1 'exp2)
(if (equal? exp1 exp2)
(printf "TRUE\n")
(printf "FALSE (line ~a)\n" the-line-number)))))]))
(verify (+ 1 1) 2)
(verify (+ 1 1) 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment