From 2996ef41ff449e035ecdc679eda89bfa2573242a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 25 Jul 2012 22:15:17 -0700 Subject: [PATCH] sequences: Fix tests that broke when nth could only be integers. Undo integer>fixnum in iota nth. See bug #582. --- basis/compiler/tree/cleanup/cleanup-tests.factor | 4 ++-- core/growable/growable-tests.factor | 4 ++-- core/sequences/sequences-tests.factor | 1 - core/sequences/sequences.factor | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/basis/compiler/tree/cleanup/cleanup-tests.factor b/basis/compiler/tree/cleanup/cleanup-tests.factor index a383b347f9..ef4aa1acfe 100644 --- a/basis/compiler/tree/cleanup/cleanup-tests.factor +++ b/basis/compiler/tree/cleanup/cleanup-tests.factor @@ -357,13 +357,13 @@ cell-bits 32 = [ [ f ] [ [ { integer } declare iota [ ] map - ] \ >fixnum inlined? + ] \ integer>fixnum inlined? ] unit-test [ f ] [ [ { integer } declare { } set-nth-unsafe - ] \ >fixnum inlined? + ] \ integer>fixnum inlined? ] unit-test [ f ] [ diff --git a/core/growable/growable-tests.factor b/core/growable/growable-tests.factor index 584d6a1918..7c4942d7fa 100644 --- a/core/growable/growable-tests.factor +++ b/core/growable/growable-tests.factor @@ -20,7 +20,7 @@ must-fail [ most-positive-fixnum 2 * 2 + V{ } clone set-length ] must-fail -[ ] [ +[ 10 V{ } [ set-length ] keep 0.5 swap set-length -] unit-test +] must-fail diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index a4167bfcbd..2ad5847cc0 100644 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -214,7 +214,6 @@ unit-test [ V{ "a" "b" } V{ } ] [ { "X" "a" "b" } { "X" } drop-prefix [ >vector ] bi@ ] unit-test -[ 0.5 10 iota nth ] [ no-method? ] must-fail-with [ 0.5 { 1 2 3 } nth ] [ no-method? ] must-fail-with [ 0.5 "asdfasdf" nth ] [ no-method? ] must-fail-with diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index dd6774011e..f6cdebcc9a 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -106,7 +106,7 @@ TUPLE: iota { n integer read-only } ; : iota ( n -- iota ) \ iota boa ; inline M: iota length n>> ; inline -M: iota nth-unsafe drop integer>fixnum ; inline +M: iota nth-unsafe drop ; inline INSTANCE: iota immutable-sequence