Some unit test fixes
parent
fb8723bce1
commit
77c4d97785
|
@ -1,4 +1,4 @@
|
|||
USING: arrays kernel sequences sequences.private growable
|
||||
USING: accessors arrays kernel sequences sequences.private growable
|
||||
tools.test vectors layouts system math vectors.private ;
|
||||
IN: arrays.tests
|
||||
|
||||
|
@ -11,7 +11,7 @@ IN: arrays.tests
|
|||
[ V{ "a" "b" "c" } ] [ { "a" "b" "c" } >vector ] unit-test
|
||||
[ f ] [ { "a" "b" "c" } dup >array eq? ] unit-test
|
||||
[ t ] [ { "a" "b" "c" } dup { } like eq? ] unit-test
|
||||
[ t ] [ { "a" "b" "c" } dup dup length array>vector underlying eq? ] unit-test
|
||||
[ t ] [ { "a" "b" "c" } dup dup length array>vector underlying>> eq? ] unit-test
|
||||
[ V{ "a" "b" "c" } ] [ { "a" "b" "c" } V{ } like ] unit-test
|
||||
[ { "a" "b" "c" } ] [ { "a" } { "b" "c" } append ] unit-test
|
||||
[ { "a" "b" "c" "d" "e" } ]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: arrays compiler.units kernel kernel.private math
|
||||
USING: accessors arrays compiler.units kernel kernel.private math
|
||||
math.constants math.private sequences strings tools.test words
|
||||
continuations sequences.private hashtables.private byte-arrays
|
||||
strings.private system random layouts vectors.private
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
IN: compiler.tests
|
||||
USING: compiler compiler.units tools.test math parser kernel
|
||||
sequences sequences.private classes.mixin generic definitions
|
||||
arrays words assocs ;
|
||||
USING: accessors compiler compiler.units tools.test math parser
|
||||
kernel sequences sequences.private classes.mixin generic
|
||||
definitions arrays words assocs ;
|
||||
|
||||
GENERIC: method-redefine-test ( a -- b )
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
IN: compiler.tests
|
||||
USING: compiler compiler.units tools.test math parser kernel
|
||||
sequences sequences.private classes.mixin generic definitions
|
||||
arrays words assocs ;
|
||||
USING: accessors compiler compiler.units tools.test math parser
|
||||
kernel sequences sequences.private classes.mixin generic
|
||||
definitions arrays words assocs ;
|
||||
|
||||
GENERIC: sheeple ( obj -- x )
|
||||
|
||||
|
|
|
@ -235,6 +235,6 @@ M: f single-combination-test-2 single-combination-test-4 ;
|
|||
10 [
|
||||
[ "compiler.tests.foo" forget-vocab ] with-compilation-unit
|
||||
[ t ] [
|
||||
"USING: prettyprint words ; IN: compiler.tests.foo : (recursive) ( -- ) (recursive) (recursive) ; inline : recursive ( -- ) (recursive) ; \\ (recursive) compiled>>" eval
|
||||
"USING: prettyprint words accessors ; IN: compiler.tests.foo : (recursive) ( -- ) (recursive) (recursive) ; inline : recursive ( -- ) (recursive) ; \\ (recursive) compiled>>" eval
|
||||
] unit-test
|
||||
] times
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
! Black box testing of templating optimization
|
||||
USING: arrays compiler kernel kernel.private math
|
||||
USING: accessors arrays compiler kernel kernel.private math
|
||||
hashtables.private math.private namespaces sequences
|
||||
sequences.private tools.test namespaces.private slots.private
|
||||
sequences.private byte-arrays alien alien.accessors layouts
|
||||
|
@ -138,7 +138,7 @@ unit-test
|
|||
0 swap hellish-bug-2 drop ;
|
||||
|
||||
[ ] [
|
||||
H{ { 1 2 } { 3 4 } } dup hash-array
|
||||
H{ { 1 2 } { 3 4 } } dup array>>
|
||||
[ 0 swap hellish-bug-2 drop ] compile-call
|
||||
] unit-test
|
||||
|
||||
|
|
|
@ -83,12 +83,14 @@ IN: cpu.x86.intrinsics
|
|||
{
|
||||
[ %slot-literal-known-tag "val" operand MOV generate-write-barrier ] H{
|
||||
{ +input+ { { f "val" } { f "obj" known-tag } { [ small-slot? ] "n" } } }
|
||||
{ +clobber+ { "obj" } }
|
||||
}
|
||||
}
|
||||
! Slot number is literal
|
||||
{
|
||||
[ %slot-literal-any-tag "val" operand MOV generate-write-barrier ] H{
|
||||
{ +input+ { { f "val" } { f "obj" } { [ small-slot? ] "n" } } }
|
||||
{ +clobber+ { "obj" } }
|
||||
}
|
||||
}
|
||||
! Slot number in a register
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: alien arrays definitions generic generic.standard
|
||||
USING: accessors alien arrays definitions generic generic.standard
|
||||
generic.math assocs hashtables io kernel math namespaces parser
|
||||
prettyprint sequences strings tools.test vectors words
|
||||
quotations classes classes.algebra continuations layouts
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: arrays generic inference inference.backend
|
||||
USING: accessors arrays generic inference inference.backend
|
||||
inference.dataflow kernel classes kernel.private math
|
||||
math.parser math.private namespaces namespaces.private parser
|
||||
sequences strings vectors words quotations effects tools.test
|
||||
|
|
|
@ -51,4 +51,4 @@ C: <color> color
|
|||
|
||||
[ bad-new-test ] must-infer
|
||||
|
||||
[ bad-new-test ] [ T{ not-a-tuple-class f V{ } } = ] must-fail-with
|
||||
[ bad-new-test ] must-fail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: math math.bitfields tools.test kernel words ;
|
||||
USING: accessors math math.bitfields tools.test kernel words ;
|
||||
IN: math.bitfields.tests
|
||||
|
||||
[ 0 ] [ { } bitfield ] unit-test
|
||||
|
@ -14,4 +14,4 @@ IN: math.bitfields.tests
|
|||
|
||||
[ 3 ] [ foo ] unit-test
|
||||
[ 3 ] [ { a b } flags ] unit-test
|
||||
[ t ] [ \ foo compiled>> ] unit-test
|
||||
\ foo must-infer
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: arrays kernel kernel.private math namespaces
|
||||
USING: accessors arrays kernel kernel.private math namespaces
|
||||
sequences sequences.private strings tools.test vectors
|
||||
continuations random growable classes ;
|
||||
IN: vectors.tests
|
||||
|
@ -70,14 +70,14 @@ IN: vectors.tests
|
|||
[ "funky" ] [ "funny-stack" get pop ] unit-test
|
||||
|
||||
[ t ] [
|
||||
V{ 1 2 3 4 } dup underlying length
|
||||
>r clone underlying length r>
|
||||
V{ 1 2 3 4 } dup underlying>> length
|
||||
>r clone underlying>> length r>
|
||||
=
|
||||
] unit-test
|
||||
|
||||
[ f ] [
|
||||
V{ 1 2 3 4 } dup clone
|
||||
[ underlying ] bi@ eq?
|
||||
[ underlying>> ] bi@ eq?
|
||||
] unit-test
|
||||
|
||||
[ 0 ] [
|
||||
|
|
|
@ -365,7 +365,7 @@ M: lambda-word definition
|
|||
"lambda" word-prop body>> ;
|
||||
|
||||
M: lambda-word reset-word
|
||||
[ f "lambda" set-word-prop ] [ call-next-method ] bi ;
|
||||
[ call-next-method ] [ f "lambda" set-word-prop ] bi ;
|
||||
|
||||
INTERSECTION: lambda-macro macro lambda-word ;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ M: macro definer drop \ MACRO: \ ; ;
|
|||
M: macro definition "macro" word-prop ;
|
||||
|
||||
M: macro reset-word
|
||||
[ f "macro" set-word-prop ] [ call-next-method ] bi ;
|
||||
[ call-next-method ] [ f "macro" set-word-prop ] bi ;
|
||||
|
||||
: macro-expand ( ... word -- quot ) "macro" word-prop call ;
|
||||
|
||||
|
|
|
@ -48,8 +48,8 @@ M: memoized definer drop \ MEMO: \ ; ;
|
|||
M: memoized definition "memo-quot" word-prop ;
|
||||
|
||||
M: memoized reset-word
|
||||
[ { "memoize" "memo-quot" } reset-props ]
|
||||
[ call-next-method ]
|
||||
[ { "memoize" "memo-quot" } reset-props ]
|
||||
bi ;
|
||||
|
||||
: memoize-quot ( quot effect -- memo-quot )
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
USING: math math.parser calendar calendar.format strings words
|
||||
kernel effects ;
|
||||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors math math.parser calendar calendar.format
|
||||
strings words kernel effects ;
|
||||
IN: present
|
||||
|
||||
GENERIC: present ( object -- string )
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
IN: tools.profiler.tests
|
||||
USING: tools.profiler tools.test kernel memory math threads
|
||||
alien tools.profiler.private sequences ;
|
||||
USING: accessors tools.profiler tools.test kernel memory math
|
||||
threads alien tools.profiler.private sequences ;
|
||||
|
||||
[ t ] [
|
||||
\ length profile-counter
|
||||
\ length counter>>
|
||||
10 [ { } length drop ] times
|
||||
\ length profile-counter =
|
||||
\ length counter>> =
|
||||
] unit-test
|
||||
|
||||
[ ] [ [ 10 [ gc ] times ] profile ] unit-test
|
||||
|
@ -31,7 +31,7 @@ alien tools.profiler.private sequences ;
|
|||
foobar
|
||||
] profile
|
||||
|
||||
[ 1 ] [ \ foobar profile-counter ] unit-test
|
||||
[ 1 ] [ \ foobar counter>> ] unit-test
|
||||
|
||||
: fooblah { } [ ] each ;
|
||||
|
||||
|
@ -39,6 +39,6 @@ alien tools.profiler.private sequences ;
|
|||
|
||||
[ foobaz ] profile
|
||||
|
||||
[ 1 ] [ \ foobaz profile-counter ] unit-test
|
||||
[ 1 ] [ \ foobaz counter>> ] unit-test
|
||||
|
||||
[ 2 ] [ \ fooblah profile-counter ] unit-test
|
||||
[ 2 ] [ \ fooblah counter>> ] unit-test
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2005, 2006 Daniel Ehrenberg
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel namespaces sequences words io assocs
|
||||
USING: accessors kernel namespaces sequences words io assocs
|
||||
quotations strings parser lexer arrays xml.data xml.writer debugger
|
||||
splitting vectors sequences.deep combinators ;
|
||||
IN: xml.utilities
|
||||
|
|
Loading…
Reference in New Issue