Changeset 38793 in project


Ignore:
Timestamp:
07/14/20 06:35:32 (4 weeks ago)
Author:
Kon Lovett
Message:

test reflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/slib-charplot/trunk/tests/slib-charplot-test.scm

    r38667 r38793  
    1919(plot "FAILS" "" "")
    2020
     21;NOTE must be proper list 4 `list->array', otherwise cons ok
     22(define (make-point n) (let ((i (/ n 6))) `(,i ,(sin i))))
     23
     24#; ;test dep
     25(define (unfold/count f n)
     26  (import (srfi 1))
     27  (unfold-right zero? f sub1 n) )
     28
     29#; ;test dep
     30(define (make-points n) (unfold/count make-point n))
     31
    2132(define (make-points n)
    2233  (if (zero? n)
    2334    '()
    24     (cons (list (/ n 6) (sin (/ n 6))) (make-points (sub1 n)))))
     35    (cons (make-point n) (make-points (sub1 n)))) )
    2536
    2637(print)
     
    3041;Fail - infinite loop forall H, W : H < 4, W < (5 + LM)
    3142(time
    32   (parameterize ((plot-left-margin #f))
    33     (parameterize ((plot-dimensions `(4 ,(+ 5 (plot-left-margin)))))
    34       (plot (list->array 2 '#() (make-points 40)) "x" "Sin(x)") ) ) )
     43  (parameterize (
     44    (plot-left-margin #f)
     45    (plot-dimensions `(4 ,(+ 5 (plot-left-margin)))) )
     46    (plot (list->array 2 '#() (make-points 40)) "x" "Sin(x)") ) )
    3547
    3648(print)
     
    3850(time
    3951  (let ((hlabel "x") (vlabel "Sin(x)"))
    40     (parameterize ((plot-left-margin (+ 2 (max (string-length hlabel) (string-length vlabel)))))
    41       (parameterize ((plot-dimensions `(24 ,(+ 54 (plot-left-margin)))))
    42         (plot (list->array 2 '#() (make-points 40)) hlabel vlabel) ) ) ) )
     52    (parameterize (
     53      (plot-left-margin (+ 2 (max (string-length hlabel) (string-length vlabel))))
     54      (plot-dimensions `(24 ,(+ 54 (plot-left-margin)))) )
     55      (plot (list->array 2 '#() (make-points 40)) hlabel vlabel) ) ) )
    4356
    4457;;;"Tests" (examples) from http://people.csail.mit.edu/jaffer/slib_5.html#SEC125
Note: See TracChangeset for help on using the changeset viewer.