From 86c87f5fda227ec574a0e47d619155f96a2cf8a4 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Wed, 4 Sep 2013 11:12:01 -0400 Subject: [PATCH] Add tests for error message pruning. --- .../tests/typed-racket/fail/error-pruning1.rkt | 11 +++++++++++ .../tests/typed-racket/fail/error-pruning2.rkt | 11 +++++++++++ .../tests/typed-racket/fail/error-pruning3.rkt | 11 +++++++++++ 3 files changed, 33 insertions(+) create mode 100644 pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning1.rkt create mode 100644 pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning2.rkt create mode 100644 pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning3.rkt diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning1.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning1.rkt new file mode 100644 index 0000000000..0e37e7cfe0 --- /dev/null +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning1.rkt @@ -0,0 +1,11 @@ +#; +(exn-pred #px"^((?!Integer).)+$") +#lang typed/racket + +;; Tests that function type pruning in errors is working. If the string +;; "Integer" shows up the error (which should be about Number), then +;; pruning is broken. +;; Because `exn-pred' only checks the first line of the error, only one +;; error expression per file (otherwise, the first line is a summary). + +(add1 'foo1) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning2.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning2.rkt new file mode 100644 index 0000000000..1fe5967fc1 --- /dev/null +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning2.rkt @@ -0,0 +1,11 @@ +#; +(exn-pred #px"^((?!Integer).)+$") +#lang typed/racket + +;; Tests that function type pruning in errors is working. If the string +;; "Integer" shows up the error (which should be about Number), then +;; pruning is broken. +;; Because `exn-pred' only checks the first line of the error, only one +;; error expression per file (otherwise, the first line is a summary). + +(+ 'foo1 3) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning3.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning3.rkt new file mode 100644 index 0000000000..3222394075 --- /dev/null +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/fail/error-pruning3.rkt @@ -0,0 +1,11 @@ +#; +(exn-pred #px"^((?!Integer).)+$") +#lang typed/racket + +;; Tests that function type pruning in errors is working. If the string +;; "Integer" shows up the error (which should be about Number), then +;; pruning is broken. +;; Because `exn-pred' only checks the first line of the error, only one +;; error expression per file (otherwise, the first line is a summary). + +(+ 'foo1 "a")