changeset 189:fa9a15681ba9

Test for repeated (failing first)
author Chris Cannam
date Sun, 05 May 2013 17:55:01 +0100
parents 8a8b07134cad
children 528f16f988d8
files yetilab/stream/filter.yeti yetilab/stream/test/test_filter.yeti
diffstat 2 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/yetilab/stream/filter.yeti	Sun May 05 12:41:50 2013 +0100
+++ b/yetilab/stream/filter.yeti	Sun May 05 17:55:01 2013 +0100
@@ -115,6 +115,7 @@
         {
             get position () = pos,
             get channels () = s.channels,
+            get sampleRate () = s.sampleRate,
             get available () = Infinite (),
             get finished? () = false,
             read count =
--- a/yetilab/stream/test/test_filter.yeti	Sun May 05 12:41:50 2013 +0100
+++ b/yetilab/stream/test/test_filter.yeti	Sun May 05 17:55:01 2013 +0100
@@ -200,6 +200,25 @@
         ( str.close (); true )
 ),
 
+"repeated-2": \(
+    str = filt.repeated
+       (syn.precalculated 2 (bl.fromList [1,2,3]));
+    compare str.position 0 and
+        compare str.channels 1 and
+        compare str.sampleRate 2 and
+        compare str.available (Infinite ()) and
+        compare str.finished? false and
+        compare (map bl.list (mat.asRows (str.read 1))) [[1]] and
+        compare (map bl.list (mat.asRows (str.read 2))) [[2,3]] and
+        compare (map bl.list (mat.asRows (str.read 3))) [[1,2,3]] and
+        compare (map bl.list (mat.asRows (str.read 5))) [[1,2,3,1,2]] and
+        compare (map bl.list (mat.asRows (str.read 2))) [[3,1]] and
+        compare str.available (Infinite ()) and
+        compare str.finished? true and
+        compare str.position 13 and
+        ( str.close (); true )
+),
+
 //!!! still no tests for filters with multi-channel inputs
 
 ] is hash<string, () -> boolean>