anchor.diff:        "pn returns correct results when its source pattern is a value")
     (is (equal
          (list 1 2 3 1 2 3 1 2 3 nil nil nil)
  -       (next-n (pn (pseq '(1 2 3) 1) 3) 12))
  +       (next-n (pn (pseq (list 1 2 3) 1) 3) 12))
         "pn returns correct results when its source pattern is a pattern")
  -  (is (null (next (pn (pseq '(1 2 3) 0) 1)))
  +  (is (null (next (pn (pseq (list 1 2 3) 0) 1)))
         "pn does not hang when its source pattern returns no values"))
   
   (test pshuf
     "Test pshuf"
     (is (= 5
  -         (length (next-upto-n (pshuf '(1 2 3 4 5) 1) 32)))
  +         (length (next-upto-n (pshuf (list 1 2 3 4 5) 1) 32)))
         "pshuf returns the correct number of results when REPEATS is specified")
     (is (= 10
  -         (length (next-upto-n (pshuf '(1 2 3 4 5) 2) 32)))
  +         (length (next-upto-n (pshuf (list 1 2 3 4 5) 2) 32)))
         "pshuf returns the correct number of results when REPEATS is specified")
     (is (equal
          (list 1 2 3 4 5)
  -       (next-upto-n (pseq '(1 2 3 4 5) 1))) ;; this list must be quoted and must be the same as one of the ones used in the pshuf test above.
  +       (next-upto-n (pseq (list 1 2 3 4 5) 1))) ;; this list must be quoted and must be the same as one of the ones used in the pshuf test above.
         "pshuf does not destructively modify its input list"))
   
   (test pwhite
  
positive.code: (test plazy
    "Test plazy"
    (is (equal (list 1 2 3 1 2 3 1)
               (next-n (plazy (lambda () (pseq '(1 2 3)))) 7))
        "plazy returns correct results")
    (is (null (next-upto-n (plazy (lambda () nil))))
        "plazy returns correct results when its function returns nil"))
  
  (test plazyn
    "Test plazyn"
    (is (null (next-upto-n (plazyn (lambda () (pseq '(1 2 3))) 0)))
        "plazyn returns 0 results if REPEATS is 0")
    (is (equal '(1 2 3 1 2 3)
               (next-upto-n (plazyn (lambda () (pseq '(1 2 3) 1)) 2)))
        "plazyn returns correct results"))
  
  ;; pcycles (FIX)
  
negative.code:                             (loop :for i :upto 200 :collect (= (peek pstr) (next pstr)))))
              "peek and next return the same values")
    (is (= 0
           (let ((pstr (as-pstream (pbind :dur 1/3 :foo (pseq (list 1 2 3) 1)))))
             (peek pstr)
             (beats-elapsed pstr)))
        "beats-elapsed should not count peeked outputs"))
  