diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/interval.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/interval.rkt index 590b41cd80..0e217a2066 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/interval.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/interval.rkt @@ -35,8 +35,8 @@ [else empty])) (defproc (lines-interval - [v1s (sequence/c (sequence/c real?))] - [v2s (sequence/c (sequence/c real?))] + [v1s (sequence/c (sequence/c #:min-count 2 real?))] + [v2s (sequence/c (sequence/c #:min-count 2 real?))] [#:x-min x-min (or/c rational? #f) #f] [#:x-max x-max (or/c rational? #f) #f] [#:y-min y-min (or/c rational? #f) #f] [#:y-max y-max (or/c rational? #f) #f] [#:color color plot-color/c (interval-color)] diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/line.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/line.rkt index b6d768d5fc..932c70625d 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/line.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/line.rkt @@ -22,7 +22,7 @@ (cond [label (line-legend-entry label color width style)] [else empty])) -(defproc (lines [vs (sequence/c (sequence/c real?))] +(defproc (lines [vs (sequence/c (sequence/c #:min-count 2 real?))] [#:x-min x-min (or/c rational? #f) #f] [#:x-max x-max (or/c rational? #f) #f] [#:y-min y-min (or/c rational? #f) #f] [#:y-max y-max (or/c rational? #f) #f] [#:color color plot-color/c (line-color)] diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/point.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/point.rkt index 2db80ac1ce..715ed961ba 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/point.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/point.rkt @@ -21,7 +21,7 @@ (if label (point-legend-entry label sym color fill-color size line-width) empty)) -(defproc (points [vs (sequence/c (sequence/c real?))] +(defproc (points [vs (sequence/c (sequence/c #:min-count 2 real?))] [#:x-min x-min (or/c rational? #f) #f] [#:x-max x-max (or/c rational? #f) #f] [#:y-min y-min (or/c rational? #f) #f] [#:y-max y-max (or/c rational? #f) #f] [#:sym sym point-sym/c (point-sym)] @@ -131,7 +131,7 @@ empty) (defproc (error-bars - [bars (sequence/c (sequence/c real?))] + [bars (sequence/c (sequence/c #:min-count 3 real?))] [#:x-min x-min (or/c rational? #f) #f] [#:x-max x-max (or/c rational? #f) #f] [#:y-min y-min (or/c rational? #f) #f] [#:y-max y-max (or/c rational? #f) #f] [#:color color plot-color/c (error-bar-color)] diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/rectangle.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/rectangle.rkt index 0db9d9ed56..7ae3e7a8e2 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/rectangle.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot2d/rectangle.rkt @@ -25,7 +25,7 @@ [else empty])) (defproc (rectangles - [rects (sequence/c (sequence/c ivl?))] + [rects (sequence/c (sequence/c #:min-count 2 ivl?))] [#:x-min x-min (or/c rational? #f) #f] [#:x-max x-max (or/c rational? #f) #f] [#:y-min y-min (or/c rational? #f) #f] [#:y-max y-max (or/c rational? #f) #f] [#:color color plot-color/c (rectangle-color)] diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/line.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/line.rkt index 79518fe563..f8937c2307 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/line.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/line.rkt @@ -35,7 +35,7 @@ (lines3d-render-proc vs-thnk color width style alpha label)))])) (defproc (lines3d - [vs (sequence/c (sequence/c real?))] + [vs (sequence/c (sequence/c #:min-count 3 real?))] [#:x-min x-min (or/c rational? #f) #f] [#:x-max x-max (or/c rational? #f) #f] [#:y-min y-min (or/c rational? #f) #f] [#:y-max y-max (or/c rational? #f) #f] [#:z-min z-min (or/c rational? #f) #f] [#:z-max z-max (or/c rational? #f) #f] diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/point.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/point.rkt index 5c28bb9288..07ed26af19 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/point.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/point.rkt @@ -20,7 +20,7 @@ [else empty])) (defproc (points3d - [vs (sequence/c (sequence/c real?))] + [vs (sequence/c (sequence/c #:min-count 3 real?))] [#:x-min x-min (or/c rational? #f) #f] [#:x-max x-max (or/c rational? #f) #f] [#:y-min y-min (or/c rational? #f) #f] [#:y-max y-max (or/c rational? #f) #f] [#:z-min z-min (or/c rational? #f) #f] [#:z-max z-max (or/c rational? #f) #f] diff --git a/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/rectangle.rkt b/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/rectangle.rkt index e6dec83e6b..265c442bd0 100644 --- a/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/rectangle.rkt +++ b/pkgs/plot-pkgs/plot-lib/plot/private/plot3d/rectangle.rkt @@ -25,7 +25,7 @@ [else empty])) (defproc (rectangles3d - [rects (sequence/c (sequence/c ivl?))] + [rects (sequence/c (sequence/c #:min-count 3 ivl?))] [#:x-min x-min (or/c rational? #f) #f] [#:x-max x-max (or/c rational? #f) #f] [#:y-min y-min (or/c rational? #f) #f] [#:y-max y-max (or/c rational? #f) #f] [#:z-min z-min (or/c rational? #f) #f] [#:z-max z-max (or/c rational? #f) #f] diff --git a/pkgs/plot-pkgs/plot-test/plot/tests/termination-tests.rkt b/pkgs/plot-pkgs/plot-test/plot/tests/PRs/13620.rkt similarity index 100% rename from pkgs/plot-pkgs/plot-test/plot/tests/termination-tests.rkt rename to pkgs/plot-pkgs/plot-test/plot/tests/PRs/13620.rkt diff --git a/pkgs/plot-pkgs/plot-test/plot/tests/PRs/13709.rkt b/pkgs/plot-pkgs/plot-test/plot/tests/PRs/13709.rkt new file mode 100644 index 0000000000..c8869e0071 --- /dev/null +++ b/pkgs/plot-pkgs/plot-test/plot/tests/PRs/13709.rkt @@ -0,0 +1,19 @@ +#lang racket + +(require plot rackunit) + +(check-exn #rx"'\\(1\\)" (λ () (lines '((1))))) +(check-exn #rx"\\(list \\(ivl 1 2\\)\\)" (λ () (rectangles (list (list (ivl 1 2)))))) +(check-exn #rx"'\\(1\\)" (λ () (points '((1))))) +(check-exn #rx"'\\(1\\)" (λ () (error-bars '((1))))) +(check-exn #rx"'\\(1 2\\)" (λ () (error-bars '((1 2))))) +(check-exn #rx"'\\(1\\)" (λ () (lines-interval '((1)) '((1 2))))) +(check-exn #rx"'\\(1\\)" (λ () (lines-interval '((1 2)) '((1))))) + +(check-exn #rx"'\\(1\\)" (λ () (lines3d '((1))))) +(check-exn #rx"'\\(1 2\\)" (λ () (lines3d '((1 2))))) +(check-exn #rx"\\(list \\(ivl 1 2\\)\\)" (λ () (rectangles3d (list (list (ivl 1 2)))))) +(check-exn #rx"\\(list \\(ivl 1 2\\) \\(ivl 2 3\\)\\)" (λ () (rectangles3d + (list (list (ivl 1 2) (ivl 2 3)))))) +(check-exn #rx"'\\(1\\)" (λ () (points3d '((1))))) +(check-exn #rx"'\\(1 2\\)" (λ () (points3d '((1 2)))))