basis: Cleaning up tests using lists and IN: forms.

locals-and-roots
Doug Coleman 2016-03-30 20:04:14 -07:00
parent c133c16377
commit 391f8e433f
50 changed files with 79 additions and 131 deletions

View File

@ -1,7 +1,6 @@
USING: alien alien.syntax alien.c-types alien.parser
eval kernel tools.test sequences system libc alien.strings
io.encodings.ascii io.encodings.utf8 math.constants classes.struct classes
accessors compiler.units ;
USING: accessors alien.c-types alien.syntax classes
classes.struct compiler.units eval io.encodings.ascii kernel
math.constants tools.test ;
FROM: alien.c-types => short ;
IN: alien.c-types.tests

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors tools.test alien.complex classes.struct kernel
alien.c-types alien.syntax namespaces math ;
USING: accessors alien.c-types alien.complex classes.struct math
namespaces tools.test ;
IN: alien.complex.tests
STRUCT: complex-holder

View File

@ -1,7 +1,6 @@
USING: alien alien.data alien.syntax
classes.struct kernel sequences specialized-arrays
specialized-arrays.private tools.test compiler.units vocabs
system ;
USING: alien alien.data alien.syntax classes.struct
compiler.units kernel sequences specialized-arrays
specialized-arrays.private system tools.test vocabs ;
QUALIFIED-WITH: alien.c-types c
IN: alien.data.tests

View File

@ -1,8 +1,7 @@
! Copyright (C) 2011 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.endian classes.struct io
io.encodings.binary io.streams.byte-array kernel tools.test
alien.c-types ;
USING: accessors alien.c-types alien.endian classes.struct io
io.encodings.binary io.streams.byte-array kernel tools.test ;
IN: alien.endian.tests
STRUCT: endian-struct

View File

@ -1,5 +1,4 @@
USING: alien alien.libraries alien.syntax tools.test kernel ;
IN: alien.libraries.tests
USING: alien alien.libraries alien.syntax kernel tools.test ;
{ f } [ DLL" fadfasdfsada" dll-valid? ] unit-test

View File

@ -1,6 +1,5 @@
USING: alien.c-types alien.prettyprint alien.syntax
io.streams.string see tools.test prettyprint
io.encodings.ascii ;
USING: alien.c-types alien.syntax io.encodings.ascii
io.streams.string prettyprint see tools.test ;
IN: alien.prettyprint.tests
CONSTANT: FOO 10

View File

@ -1,7 +1,5 @@
USING: interpolate multiline
io io.directories io.encodings.ascii io.files
io.files.temp io.launcher io.streams.string kernel locals system
tools.test sequences ;
USING: interpolate io io.encodings.ascii io.files io.files.temp
io.launcher io.streams.string kernel locals sequences system ;
IN: alien.remote-control.tests
: compile-file ( contents -- )

View File

@ -1,5 +1,4 @@
USING: ascii tools.test sequences kernel math strings ;
IN: ascii.tests
USING: ascii kernel math sequences strings tools.test ;
{ t } [ CHAR: a letter? ] unit-test
{ f } [ CHAR: A letter? ] unit-test

View File

@ -1,6 +1,5 @@
USING: kernel tools.test base64 strings sequences
io.encodings.string io.encodings.ascii ;
IN: base64.tests
USING: base64 io.encodings.ascii io.encodings.string kernel
sequences strings tools.test ;
{ "abcdefghijklmnopqrstuvwxyz" } [ "abcdefghijklmnopqrstuvwxyz" ascii encode >base64 base64> ascii decode
] unit-test

View File

@ -1,5 +1,4 @@
USING: biassocs assocs namespaces tools.test hashtables kernel ;
IN: biassocs.tests
USING: assocs biassocs hashtables kernel namespaces tools.test ;
<bihash> "h" set

View File

@ -1,5 +1,4 @@
USING: binary-search math.order sequences kernel tools.test ;
IN: binary-search.tests
USING: binary-search kernel math.order sequences tools.test ;
{ f } [ 3 { } [ <=> ] with search drop ] unit-test
{ 0 } [ 3 { 3 } [ <=> ] with search drop ] unit-test

View File

@ -1,6 +1,5 @@
USING: alien sequences sequences.private arrays bit-arrays kernel
tools.test math random ;
IN: bit-arrays.tests
USING: alien arrays bit-arrays kernel math random sequences
sequences.private tools.test ;
[ -1 <bit-array> ] [ T{ bad-array-length f -1 } = ] must-fail-with

View File

@ -1,5 +1,4 @@
USING: bit-sets tools.test sets kernel bit-arrays ;
IN: bit-sets.tests
USING: bit-arrays bit-sets kernel sets tools.test ;
{ T{ bit-set f ?{ t f t f t f } } } [
T{ bit-set f ?{ t f f f t f } }

View File

@ -1,4 +1,4 @@
USING: tools.test bit-vectors vectors sequences kernel math ;
USING: bit-vectors kernel math sequences tools.test vectors ;
IN: bit-vectors.tests
{ 0 } [ 123 <bit-vector> length ] unit-test

View File

@ -1,9 +1,6 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors bitstreams io io.streams.string kernel tools.test
grouping compression.lzw multiline byte-arrays io.encodings.binary
io.streams.byte-array ;
IN: bitstreams.tests
USING: accessors bitstreams kernel tools.test ;
{ 0b1111111111 }
[

View File

@ -1,5 +1,4 @@
USING: boxes namespaces tools.test accessors ;
IN: boxes.tests
USING: accessors boxes namespaces tools.test ;
{ } [ <box> "b" set ] unit-test

View File

@ -1,7 +1,6 @@
! Copyright (C) 2011 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test byte-arrays.hex eval ;
IN: byte-arrays.hex.tests
USING: byte-arrays.hex eval tools.test ;
{ B{ 16 0 8 0 } } [ HEX{ 10 00 08 00 } ] unit-test
{ B{ 255 255 15 255 255 255 } } [ HEX{ ffff 0fff ffff } ] unit-test

View File

@ -1,5 +1,5 @@
USING: cache tools.test accessors destructors kernel assocs
namespaces ;
USING: accessors assocs cache destructors kernel namespaces
tools.test ;
IN: cache.tests
TUPLE: mock-disposable < disposable n ;

View File

@ -1,5 +1,4 @@
USING: cairo tools.test math.rectangles accessors ;
IN: cairo.tests
USING: accessors cairo math.rectangles tools.test ;
{ { 10 20 } } [
{ 10 20 } [

View File

@ -1,7 +1,5 @@
USING: arrays calendar kernel math sequences tools.test
continuations system math.order threads accessors
random ;
IN: calendar.tests
USING: accessors kernel math.order random threads tools.test ;
IN: calendar
{ f } [ 2004 12 32 0 0 0 instant <timestamp> valid-timestamp? ] unit-test
{ f } [ 2004 2 30 0 0 0 instant <timestamp> valid-timestamp? ] unit-test

View File

@ -1,6 +1,5 @@
USING: calendar.format calendar kernel math tools.test
io.streams.string accessors io math.order sequences ;
IN: calendar.format.tests
USING: accessors calendar calendar.format io io.streams.string
kernel math.order sequences tools.test ;
{ 0 } [
"Z" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours

View File

@ -1,9 +1,6 @@
! Copyright (C) 2005 Chris Double. All Rights Reserved.
! See http://factorcode.org/license.txt for BSD license.
!
USING: kernel tools.test math channels channels.private
sequences threads sorting ;
IN: channels.tests
USING: channels kernel sequences sorting threads tools.test ;
{ V{ 10 } } [
V{ } clone <channel>

View File

@ -1,9 +1,7 @@
! Copyright (C) 2005 Chris Double. All Rights Reserved.
! See http://factorcode.org/license.txt for BSD license.
!
USING: kernel tools.test math assocs channels channels.remote
channels.remote.private ;
IN: channels.remote.tests
USING: assocs channels channels.remote channels.remote.private
kernel tools.test ;
{ t } [
remote-channels assoc?

View File

@ -1,5 +1,4 @@
USING: checksums.adler-32 checksums strings tools.test ;
IN: checksums.adler-32.tests
USING: checksums checksums.adler-32 strings tools.test ;
{ 300286872 } [ "Wikipedia" adler-32 checksum-bytes ] unit-test
{ 2679885283 } [ 10000 CHAR: a <string> adler-32 checksum-bytes ] unit-test

View File

@ -1,5 +1,4 @@
USING: checksums.bsd checksums strings tools.test ;
IN: checksums.bsd
USING: checksums checksums.bsd strings tools.test ;
{ 15816 } [ "Wikipedia" bsd checksum-bytes ] unit-test
{ 47937 } [ 10000 CHAR: a <string> bsd checksum-bytes ] unit-test

View File

@ -1,5 +1,4 @@
USING: checksums kernel sequences tools.test ;
IN: checksums.fletcher
USING: checksums checksums.fletcher kernel sequences tools.test ;
{
{ 51440 3948201259 14034561336514601929 }

View File

@ -1,5 +1,4 @@
USING: checksums.fnv1 checksums strings tools.test ;
IN: checksums.fnv1.tests
USING: checksums checksums.fnv1 tools.test ;
! A few test vectors taken from http://www.isthe.com/chongo/src/fnv/test_fnv.c

View File

@ -1,7 +1,5 @@
USING: kernel io strings byte-arrays sequences namespaces math
math.parser parser checksums.hmac tools.test checksums.md5
checksums.sha checksums ;
IN: checksums.hmac.tests
USING: checksums.hmac checksums.md5 checksums.sha math.parser
sequences strings tools.test ;
{
"\u000092\u000094rz68\u0000bb\u00001c\u000013\u0000f4\u00008e\u0000f8\u000015\u00008b\u0000fc\u00009d"

View File

@ -1,7 +1,6 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test checksums.interleave checksums.sha ;
IN: checksums.interleave.tests
USING: checksums.interleave checksums.sha tools.test ;
{
B{

View File

@ -1,9 +1,7 @@
! Copyright (C) 2010 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: checksums checksums.internet tools.test ;
IN: checksums
IN: checksums.internet.tests
{ B{ 255 255 } } [ { } internet checksum-bytes ] unit-test
{ B{ 254 255 } } [ { 1 } internet checksum-bytes ] unit-test

View File

@ -1,9 +1,7 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: byte-arrays checksums checksums.md5 io.encodings.binary
io.streams.byte-array kernel math math.parser namespaces
tools.test sequences ;
IN: checksums.md5.tests
io.streams.byte-array kernel math.parser sequences tools.test ;
{ "d41d8cd98f00b204e9800998ecf8427e" } [ "" >byte-array md5 checksum-bytes bytes>hex-string ] unit-test
{ "0cc175b9c0f1b6a831c399e269772661" } [ "a" >byte-array md5 checksum-bytes bytes>hex-string ] unit-test

View File

@ -1,6 +1,5 @@
USING: byte-arrays checksums fry kernel math sequences
tools.test ;
IN: checksums.murmur
USING: byte-arrays checksums checksums.murmur fry kernel math
sequences tools.test ;
{ 455139366 } [ "asdf" >byte-array 0 <murmur3-32> checksum-bytes ] unit-test
{ 417250299 } [ "asdf" >byte-array 156 <murmur3-32> checksum-bytes ] unit-test

View File

@ -1,6 +1,5 @@
USING: accessors byte-arrays checksums checksums.openssl
combinators.short-circuit kernel system tools.test ;
IN: checksums.openssl.tests
{
B{ 201 238 222 100 92 200 182 188 138 255 129 163 115 88 240 136 }

View File

@ -1,6 +1,6 @@
USING: arrays checksums checksums.sha checksums.sha.private
io.encodings.binary io.streams.byte-array kernel math
math.parser namespaces sequences tools.test ;
io.encodings.binary io.streams.byte-array kernel math.parser
sequences tools.test ;
IN: checksums.sha.tests
: test-checksum ( text identifier -- checksum )

View File

@ -1,6 +1,5 @@
USING: byte-arrays checksums fry kernel math sequences
tools.test ;
IN: checksums.superfast
USING: byte-arrays checksums checksums.superfast fry kernel math
sequences tools.test ;
{
{

View File

@ -1,5 +1,4 @@
USING: byte-arrays checksums tools.test ;
IN: checksums.xxhash
USING: byte-arrays checksums checksums.xxhash tools.test ;
{ 1584409650 } [ "asdf" 0 <xxhash> checksum-bytes ] unit-test
{ 4257502458 } [ "Hello World!" 12345 <xxhash> checksum-bytes ] unit-test

View File

@ -1,8 +1,7 @@
! Copyright (C) 2009 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
USING: classes.struct.bit-accessors tools.test effects kernel
sequences random stack-checker ;
IN: classes.struct.bit-accessors.test
USING: classes.struct.bit-accessors effects random stack-checker
tools.test ;
{ t } [ 20 random 20 random bit-reader infer ( alien -- n ) effect= ] unit-test
{ t } [ 20 random 20 random bit-writer infer ( n alien -- ) effect= ] unit-test

View File

@ -1,14 +1,14 @@
! (c)Joe Groff bsd license
USING: accessors alien alien.c-types alien.data alien.syntax
ascii assocs byte-arrays classes.struct
classes.struct.prettyprint classes.struct.prettyprint.private
classes.tuple.parser classes.tuple.private classes.tuple
combinators compiler.tree.debugger compiler.units delegate
destructors io.encodings.utf8 io.pathnames io.streams.string
kernel libc literals math mirrors namespaces prettyprint
prettyprint.config see sequences specialized-arrays system
tools.test parser lexer eval layouts generic.single classes
vocabs generic classes.private definitions specialized-arrays.private ;
assocs byte-arrays classes classes.private classes.struct
classes.struct.prettyprint.private classes.tuple
classes.tuple.parser classes.tuple.private combinators
compiler.tree.debugger compiler.units definitions delegate
destructors eval generic generic.single io.encodings.utf8
io.streams.string kernel layouts lexer libc literals math
mirrors namespaces parser prettyprint prettyprint.config see
sequences specialized-arrays specialized-arrays.private
system tools.test vocabs ;
FROM: math => float ;
QUALIFIED-WITH: alien.c-types c
SPECIALIZED-ARRAY: char

View File

@ -1,7 +1,6 @@
USING: alien.c-types cocoa cocoa.messages cocoa.subclassing
cocoa.types compiler.test kernel namespaces cocoa.classes
cocoa.runtime tools.test memory compiler.units math
core-graphics.types ;
USING: alien.c-types cocoa cocoa.classes cocoa.subclassing
cocoa.types compiler.test core-graphics.types kernel math memory
namespaces tools.test ;
IN: cocoa.tests
CLASS: Foo < NSObject

View File

@ -1,6 +1,5 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test colors.constants colors ;
IN: colors.constants.tests
USING: colors colors.constants tools.test ;
{ t } [ COLOR: light-green rgba? ] unit-test

View File

@ -1,10 +1,7 @@
! Copyright (C) 2010 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: colors colors.hex tools.test ;
IN: colors.hex.test
{ HEXCOLOR: 000000 } [ 0.0 0.0 0.0 1.0 <rgba> ] unit-test
{ HEXCOLOR: FFFFFF } [ 1.0 1.0 1.0 1.0 <rgba> ] unit-test
{ HEXCOLOR: abcdef } [ "abcdef" hex>rgba ] unit-test

View File

@ -1,4 +1,4 @@
USING: accessors kernel colors colors.hsv tools.test math ;
USING: accessors colors colors.hsv kernel math tools.test ;
IN: colors.hsv.tests
: hsv>rgb ( h s v -- r g b )

View File

@ -1,5 +1,4 @@
USING: colors.constants kernel tools.test ;
IN: colors.mix
USING: colors.constants colors.mix kernel tools.test ;
{ COLOR: blue } [ COLOR: blue COLOR: red 0.0 linear-gradient ] unit-test
{ COLOR: red } [ COLOR: blue COLOR: red 1.0 linear-gradient ] unit-test

View File

@ -1,5 +1,5 @@
USING: columns sequences kernel namespaces arrays tools.test math ;
IN: columns.tests
USING: arrays columns kernel math namespaces sequences
tools.test ;
! Columns
{ { 1 2 3 } { 4 5 6 } { 7 8 9 } } [ clone ] map "seq" set

View File

@ -1,7 +1,6 @@
! Copyright (C) 2010 Jon Harper.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test combinators.random combinators.random.private ;
IN: combinators.random.tests
USING: combinators.random combinators.random.private tools.test ;
{ 1 } [ 1 [ 1 ] [ 2 ] ifp ] unit-test
{ 2 } [ 0 [ 1 ] [ 2 ] ifp ] unit-test

View File

@ -1,4 +1,5 @@
USING: kernel math tools.test combinators.short-circuit accessors ;
USING: accessors combinators.short-circuit kernel math
tools.test ;
IN: combinators.short-circuit.tests
{ 3 } [ { [ 1 ] [ 2 ] [ 3 ] } 0&& ] unit-test

View File

@ -1,5 +1,4 @@
USING: kernel math tools.test combinators.short-circuit.smart ;
IN: combinators.short-circuit.smart.tests
USING: combinators.short-circuit.smart kernel math tools.test ;
{ t } [ { [ 1 ] [ 2 ] [ 3 ] } && 3 = ] unit-test
{ t } [ 3 { [ 0 > ] [ odd? ] [ 2 + ] } && 5 = ] unit-test

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators.smart kernel math
sequences stack-checker tools.test locals ;
USING: accessors arrays assocs combinators.smart kernel locals
math sequences stack-checker tools.test ;
IN: combinators.smart.tests
: test-bi ( -- 9 11 )

View File

@ -1,5 +1,4 @@
USING: namespaces splitting tools.test ;
IN: command-line
USING: command-line namespaces tools.test ;
{ "factor" f { "a" "b" "c" } } [
{ "factor" "-run=test-voc" "a" "b" "c" } parse-command-line

View File

@ -1,5 +1,4 @@
USING: compiler.utilities kernel tools.test ;
IN: compiler.utilities.tests
{
9