fix type of non-empty-string? (#427)

fixes #426
This commit is contained in:
Alex Knauth 2016-09-12 09:17:57 -04:00 committed by Sam Tobin-Hochstadt
parent e706928a77
commit bbb62da731
2 changed files with 13 additions and 1 deletions

View File

@ -177,7 +177,7 @@
#:repeat? Univ #f
-String)]
[non-empty-string? (make-pred-ty -String)]
[non-empty-string? (asym-pred Univ -Boolean (-PS (-is-type 0 -String) -tt))]
[string-contains? (-> -String -String -Boolean)]
[string-prefix? (-> -String -String -Boolean)]
[string-suffix? (-> -String -String -Boolean)]

View File

@ -0,0 +1,12 @@
#lang typed/racket
;; Test for Github issue #426
;; https://github.com/racket/typed-racket/issues/426
(require racket/string typed/rackunit)
(check-equal? (non-empty-string? "foo") #true)
(check-equal? (non-empty-string? "") #false)
(check-equal? (if (non-empty-string? "foo") 'A 'B) 'A)
(check-equal? (if (non-empty-string? "") 'A 'B) 'B)