Mercurial > hg > may
diff test/test_fvector.yeti @ 35:1f80673af4c7
Make concat take a list of arbitrary length; test it, and improve test output
author | Chris Cannam |
---|---|
date | Sat, 22 Dec 2012 10:08:06 +0000 |
parents | e20d3c23a243 |
children | fa49869bda51 |
line wrap: on
line diff
--- a/test/test_fvector.yeti Fri Dec 21 22:56:45 2012 +0000 +++ b/test/test_fvector.yeti Sat Dec 22 10:08:06 2012 +0000 @@ -85,17 +85,25 @@ vec.equal (vec.resizedTo 2 (vec.vector [1,2,3])) (vec.vector [1,2]); ), -"concat": \( +"concat2": \( v = vec.vector [1,2,3]; w = vec.vector [4,5,6]; - x = vec.concat v w; + x = vec.concat [v, w]; x' = vec.vector [1,2,3,4,5,6]; vec.equal x x' and (v[0] := 0; // check result is not aliasing inputs w[0] := 0; vec.equal x x') and - vec.equal x' (vec.concat x' (vec.vector [])) and - vec.equal x' (vec.concat (vec.vector []) x') + vec.equal x' (vec.concat [x', vec.vector []]) and + vec.equal x' (vec.concat [vec.vector [], x']) +), + +"concatn": \( + v = vec.vector [1,2,3]; + w = vec.vector [4,5,6]; + vec.equal (vec.concat []) (vec.zeros 0) and + vec.equal (vec.concat [v]) v and + vec.equal (vec.concat [v,w,v]) (vec.vector [1,2,3,4,5,6,1,2,3]) ), ];