From b4b0837a77f8ed33658325d9038d2ab043966fe1 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 31 Jul 2015 16:52:44 -0500 Subject: [PATCH] Move syntax-source-* tests from unstable-test. --- .../tests/syntax/tests/location.rkt | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pkgs/racket-test/tests/syntax/tests/location.rkt diff --git a/pkgs/racket-test/tests/syntax/tests/location.rkt b/pkgs/racket-test/tests/syntax/tests/location.rkt new file mode 100644 index 0000000000..ffa8a73d23 --- /dev/null +++ b/pkgs/racket-test/tests/syntax/tests/location.rkt @@ -0,0 +1,30 @@ +#lang racket/base + +(require rackunit rackunit/text-ui + mzlib/etc + syntax/location) + +(define here + (datum->syntax + #f 'here + (list (build-path (this-expression-source-directory) + (this-expression-file-name)) + 1 1 1 1))) + +(run-tests + (test-suite "Syntax Source Locations" + (test-suite "syntax-source-file-name" + (test-case "here" + (check-equal? (syntax-source-file-name here) + (this-expression-file-name))) + (test-case "fail" + (check-equal? (syntax-source-file-name (datum->syntax #f 'fail)) + #f))) + + (test-suite "syntax-source-directory" + (test-case "here" + (check-equal? (syntax-source-directory here) + (this-expression-source-directory))) + (test-case "fail" + (check-equal? (syntax-source-directory (datum->syntax #f 'fail)) + #f)))))