-USING: accessors alien alien.accessors alien.c-types alien.libraries
-alien.syntax arrays byte-arrays continuations fry kernel kernel.private
-layouts libc math namespaces prettyprint sequences system tools.memory
-tools.test ;
+USING: accessors alien alien.accessors alien.c-types
+alien.syntax byte-arrays continuations fry kernel layouts math
+namespaces prettyprint sequences tools.memory tools.test ;
QUALIFIED: sets
IN: alien.tests
USING: accessors arrays kernel kernel.private layouts literals math
sequences tools.test vectors ;
-IN: arrays.tests
[ -2 { "a" "b" "c" } nth ] must-fail
[ 10 { "a" "b" "c" } nth ] must-fail
-USING: kernel math namespaces make tools.test vectors sequences
-sequences.private hashtables io prettyprint assocs
-continuations specialized-arrays alien.c-types ;
+USING: alien.c-types assocs kernel make math namespaces
+sequences specialized-arrays tools.test ;
+IN: assocs.tests
SPECIALIZED-ARRAY: double
IN: assocs.tests
USING: byte-arrays kernel math sequences sequences.private
tools.test ;
-IN: byte-arrays.tests
{ 6 B{ 1 2 3 } } [
6 B{ 1 2 3 } resize-byte-array
-USING: tools.test byte-vectors vectors sequences kernel
-prettyprint math ;
+USING: byte-vectors math prettyprint sequences tools.test
+vectors ;
IN: byte-vectors.tests
{ 0 } [ 123 <byte-vector> length ] unit-test
-USING: checksums checksums.crc32 kernel math tools.test namespaces ;
+USING: checksums checksums.crc32 tools.test ;
{ B{ 0 0 0 0 } } [ "" crc32 checksum-bytes ] unit-test
-USING: alien arrays definitions generic assocs hashtables io
-kernel math namespaces parser prettyprint sequences strings
-tools.test words quotations classes classes.algebra
-classes.private classes.union classes.mixin classes.predicate
-vectors source-files compiler.units growable random
-stack-checker effects kernel.private sbufs math.order
-classes.tuple accessors generic.private ;
+USING: accessors arrays assocs classes classes.algebra
+classes.tuple classes.union generic generic.private growable
+kernel math prettyprint quotations random sbufs sequences
+stack-checker strings tools.test vectors words ;
IN: classes.algebra.tests
TUPLE: first-one ;
-USING: tools.test words sequences kernel memory accessors ;
+USING: accessors kernel memory sequences tools.test words ;
IN: classes.builtin.tests
{ f } [
-USING: alien arrays generic assocs hashtables io
-io.streams.string kernel math namespaces parser prettyprint
-sequences strings tools.test vectors words quotations classes
-classes.private classes.union classes.mixin classes.predicate
-classes.algebra definitions source-files compiler.units
-kernel.private sorting vocabs memory eval accessors sets ;
+USING: assocs classes classes.private compiler.units definitions
+eval generic io.streams.string kernel math multiline namespaces
+parser sequences sets sorting tools.test vocabs words ;
IN: classes.tests
{ t } [ 3 object instance? ] unit-test
! Copyright (C) 2015 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors classes classes.error classes.tuple
-compiler.units effects eval generic io.streams.string kernel
-math namespaces parser tools.test words words.symbol ;
+compiler.units effects eval generic kernel tools.test words ;
IN: classes.error.tests
! Test error classes
-USING: kernel tools.test generic generic.standard classes math
-accessors classes.intersection slots math.order ;
+USING: accessors generic kernel math math.order slots tools.test ;
IN: classes.intersection.tests
TUPLE: a ;
! Copyright (C) 2011 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: classes.maybe eval generic.single kernel tools.test
-math classes accessors slots classes.algebra
-classes.algebra.private ;
+USING: accessors classes classes.algebra classes.algebra.private
+classes.maybe eval generic.single kernel math slots tools.test ;
IN: classes.maybe.tests
{ t } [ 3 maybe{ integer } instance? ] unit-test
-USING: alien arrays definitions generic assocs hashtables io kernel
-math namespaces parser prettyprint sequences strings tools.test words
-quotations classes classes.private classes.union classes.mixin
-classes.predicate classes.algebra vectors source-files compiler.units
-kernel.private sorting vocabs eval ;
+USING: arrays assocs classes classes.algebra classes.mixin
+compiler.units definitions eval hashtables io.streams.string
+kernel math parser sequences source-files strings tools.test
+vectors words ;
IN: classes.mixin.tests
! Test mixins
-USING: math tools.test classes.algebra words kernel sequences assocs
-accessors eval definitions compiler.units generic strings classes
-generic.single ;
+USING: accessors assocs classes classes.algebra compiler.units
+eval generic.single kernel math strings tools.test words ;
IN: classes.predicate.tests
PREDICATE: negative < integer 0 < ;
-USING: kernel classes.singleton tools.test prettyprint io.streams.string see ;
+USING: classes.singleton io.streams.string kernel see tools.test ;
IN: classes.singleton.tests
{ } [ SINGLETON: bzzt ] unit-test
USING: accessors arrays assocs calendar classes classes.algebra
classes.private classes.tuple classes.tuple.private columns
-compiler.errors compiler.units continuations definitions
-effects eval generic generic.single generic.standard grouping
-io.streams.string kernel kernel.private math math.constants
-math.order namespaces parser parser.notes prettyprint
-quotations random see sequences sequences.private slots
-slots.private splitting strings summary threads tools.test
-vectors vocabs words words.symbol fry literals memory
-combinators.short-circuit ;
+combinators.short-circuit compiler.errors compiler.units
+definitions eval generic generic.single io.streams.string kernel
+kernel.private literals math math.constants memory namespaces
+parser parser.notes see sequences sequences.private slots
+splitting strings threads tools.test vectors vocabs words
+words.symbol ;
IN: classes.tuple.tests
TUPLE: rect x y w h ;
-USING: accessors alien arrays definitions generic assocs
-hashtables io kernel math namespaces parser prettyprint
-sequences strings tools.test vectors words quotations classes
-classes.private classes.union classes.mixin classes.predicate
-classes.algebra classes.union.private source-files
-compiler.units kernel.private sorting vocabs io.streams.string
-eval see math.private slots generic.single ;
+USING: accessors alien assocs classes classes.algebra
+classes.predicate classes.union classes.union.private
+compiler.units eval io.streams.string kernel math math.private
+parser quotations see sequences slots strings tools.test words ;
IN: classes.union.tests
! DEFER: bah
-USING: alien strings kernel math tools.test io prettyprint
-namespaces combinators words classes sequences accessors
-math.functions arrays combinators.private stack-checker ;
+USING: accessors arrays combinators combinators.private io
+kernel math math.functions prettyprint sequences stack-checker
+tools.test words ;
IN: combinators.tests
{ 3 } [ 1 2 [ + ] call( x y -- z ) ] unit-test
-USING: compiler definitions compiler.units tools.test arrays sequences words kernel
-accessors namespaces fry eval quotations math ;
+USING: arrays compiler compiler.units definitions eval fry
+kernel math namespaces quotations sequences tools.test words ;
IN: compiler.units.tests
[ [ [ ] define-temp ] with-compilation-unit ] must-infer
-USING: accessors continuations debugger eval hashtables io
-kernel kernel.private math memory namespaces sequences
-tools.test vectors words ;
+USING: accessors continuations debugger eval io kernel
+kernel.private math memory namespaces sequences tools.test
+vectors words ;
IN: continuations.tests
: (callcc1-test) ( n obj -- n' obj )
-USING: tools.test generic kernel definitions sequences
-compiler.units words ;
+USING: arrays bit-arrays byte-arrays compiler.units definitions
+tools.test ;
IN: definitions.tests
GENERIC: some-generic ( a -- b )
-USING: destructors kernel tools.test continuations accessors
-namespaces sequences destructors.private ;
+USING: accessors continuations destructors destructors.private
+kernel namespaces sequences tools.test ;
IN: destructors.tests
TUPLE: dispose-error ;
-USING: effects effects.parser eval kernel tools.test prettyprint accessors
-quotations sequences ;
+USING: accessors effects effects.parser eval kernel prettyprint
+sequences tools.test ;
IN: effects.tests
{ t } [ { "a" } { "a" } <effect> { "a" "b" } { "a" "b" } <effect> effect<= ] unit-test
-USING: generic.math math tools.test kernel ;
-IN: generic.math.tests
+USING: generic.math kernel math tools.test ;
! Test math-combination
{ [ [ >float ] dip ] } [ \ real \ float math-upgrade ] unit-test
USING: generic.parser tools.test ;
-IN: generic.parser.tests
-
{ t } [ ( -- ) ( -- ) method-effect= ] unit-test
{ t } [ ( a -- b ) ( x -- y ) method-effect= ] unit-test
{ f } [ ( a b -- c ) ( x -- y ) method-effect= ] unit-test
-USING: math sequences classes growable tools.test kernel
-layouts ;
+USING: classes kernel layouts math sequences tools.test ;
IN: growable.tests
! erg found this one
! Copyright (C) 2010 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors fry hash-sets kernel math prettyprint
-sequences sets sorting tools.test ;
-IN: hash-sets.tests
+USING: accessors fry hash-sets kernel math prettyprint sequences
+sets sorting tools.test ;
{ { 1 2 3 } } [ HS{ 1 2 3 } members natural-sort ] unit-test
USING: accessors assocs continuations fry hashtables kernel make
-math namespaces sequences slots.private tools.test ;
-IN: hashtables.tests
+math namespaces sequences tools.test ;
{ H{ } } [ { } [ dup ] H{ } map>assoc ] unit-test
-USING: io.encodings.string io.encodings.ascii tools.test strings arrays ;
-IN: io.encodings.ascii.tests
+USING: arrays io.encodings.ascii io.encodings.string strings
+tools.test ;
{ B{ CHAR: f CHAR: o CHAR: o } } [ "foo" ascii encode ] unit-test
[ { 128 } >string ascii encode ] must-fail
! Copyright (C) 2008 Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel tools.test io.encodings.utf16 arrays sbufs
-io.streams.byte-array sequences io.encodings io strings
-io.encodings.string alien.c-types alien.strings accessors classes ;
-IN: io.encodings.utf16.tests
+USING: arrays io.encodings.string io.encodings.utf16 strings
+tools.test ;
{ { CHAR: x } } [ B{ 0 CHAR: x } utf16be decode >array ] unit-test
{ { 0x1D11E } } [ B{ 0xD8 0x34 0xDD 0x1E } utf16be decode >array ] unit-test
-USING: accessors alien.c-types alien.data kernel
-io.encodings.utf16 io.streams.byte-array tools.test ;
-IN: io.encodings.utf16n
+USING: accessors alien.data io.encodings.utf16
+io.streams.byte-array kernel tools.test ;
+IN: io.encodings.utf16n.tests
: correct-endian ( obj -- ? )
code>> little-endian? [ utf16le = ] [ utf16be = ] if ;
-USING: io.encodings.utf8 tools.test io.encodings.string strings arrays
-bootstrap.unicode kernel sequences ;
+USING: arrays io.encodings.string io.encodings.utf8 kernel
+sequences strings tools.test ;
IN: io.encodings.utf8.tests
: decode-utf8-w/stream ( array -- newarray )
-USING: accessors io io.streams.string kernel math parser sbufs
-sequences tools.test words namespaces strings ;
+USING: accessors io io.streams.string kernel math namespaces
+parser sbufs sequences strings tools.test words ;
IN: io.tests
{ f } [
-USING: tools.test io.streams.byte-array io.encodings.binary
-io.encodings.utf8 io kernel arrays strings namespaces math
-specialized-arrays alien.c-types alien.data io.encodings.ascii ;
-SPECIALIZED-ARRAY: int
+USING: alien.c-types alien.data arrays io io.encodings.ascii
+io.encodings.binary io.encodings.utf8 io.streams.byte-array
+kernel math specialized-arrays strings tools.test ;
IN: io.streams.byte-array.tests
+SPECIALIZED-ARRAY: int
{ B{ } } [ B{ } binary [ contents ] with-byte-reader ] unit-test
-USING: arrays byte-arrays kernel kernel.private literals math
-memory namespaces sequences tools.test math.private quotations
-continuations prettyprint io.streams.string debugger assocs
-sequences.private accessors locals.backend grouping words
-system alien alien.accessors kernel.private ;
+USING: accessors alien alien.accessors arrays assocs byte-arrays
+continuations debugger grouping io.streams.string kernel
+kernel.private literals locals.backend math memory namespaces
+prettyprint sequences sequences.private tools.test words ;
IN: kernel.tests
{ 0 } [ f size ] unit-test
USING: layouts math tools.test ;
-IN: system.tests
{ t } [ cell integer? ] unit-test
{ t } [ bootstrap-cell integer? ] unit-test
-
USING: make sequences tools.test ;
-IN: make
{ "ABCD" } [ [ "ABCD" [ , ] each ] "" make ] unit-test
-USING: kernel math math.constants math.order tools.test sequences
-grouping ;
-IN: math.floats.tests
+USING: grouping kernel math math.constants math.order sequences
+tools.test ;
{ t } [ 0.0 float? ] unit-test
{ t } [ 3.1415 number? ] unit-test
-USING: kernel math math.functions math.order namespaces
-prettyprint math.private continuations tools.test sequences
-random prettyprint.config ;
+USING: continuations kernel math math.functions math.order
+math.private namespaces prettyprint prettyprint.config random
+sequences tools.test ;
IN: math.integers.tests
10 number-base [
-USING: kernel layouts math math.private namespaces make tools.test ;
+USING: kernel layouts make math math.private tools.test ;
IN: math.tests
{ } [ 5 [ ] times ] unit-test
-USING: kernel math.order tools.test ;
-IN: math.order.tests
+USING: math.order tools.test ;
{ +lt+ } [ "ab" "abc" <=> ] unit-test
{ +gt+ } [ "abc" "ab" <=> ] unit-test
-USING: kernel layouts literals math math.parser sequences
-tools.test ;
-IN: math.parser.tests
+USING: layouts literals math math.parser sequences tools.test ;
{ f }
[ f string>number ]
-USING: kernel math math.order math.parser math.ratios
-math.functions tools.test ;
-IN: math.ratios.tests
+USING: kernel math math.functions math.parser tools.test ;
{ 1 2 } [ 1/2 >fraction ] unit-test
-USING: accessors byte-arrays effects kernel kernel.private math memory
-prettyprint io sequences tools.test words namespaces layouts classes
-classes.builtin arrays quotations system ;
+USING: accessors arrays byte-arrays effects kernel
+kernel.private math memory namespaces quotations sequences
+tools.test words ;
FROM: tools.memory => data-room code-room ;
IN: memory.tests
USING: assocs compiler.tree.debugger kernel namespaces
-tools.test words ;
+tools.test ;
IN: namespaces.tests
H{ } clone "test-namespace" set
-USING: arrays math parser tools.test kernel generic words
-io.streams.string namespaces classes effects source-files assocs
-sequences strings io.files io.pathnames definitions
-continuations sorting classes.tuple compiler.units debugger
-vocabs vocabs.loader accessors eval combinators lexer
-vocabs.parser words.symbol multiline source-files.errors
-tools.crossref grouping sets ;
+USING: accessors arrays assocs classes compiler.units effects
+eval generic grouping io.pathnames io.streams.string kernel
+lexer math multiline namespaces parser sequences sets
+source-files source-files.errors strings tools.crossref
+tools.test vocabs vocabs.parser words words.symbol ;
IN: parser.tests
{ 1 [ 2 [ 3 ] 4 ] 5 }
-USING: math kernel quotations tools.test sequences ;
-IN: quotations.tests
+USING: kernel math quotations sequences tools.test ;
{ [ 3 ] } [ 3 [ ] curry ] unit-test
{ [ \ + ] } [ \ + [ ] curry ] unit-test
USING: classes kernel math namespaces sbufs sequences
sequences.private strings tools.test ;
-IN: sbufs.tests
{ 5 } [ "Hello" >sbuf length ] unit-test
-USING: arrays byte-arrays kernel math math.order math.parser
-namespaces sequences kernel.private sequences.private strings
-sbufs tools.test vectors assocs generic vocabs.loader
-generic.single math.vectors math.functions ;
+USING: arrays assocs byte-arrays generic.single kernel make math
+math.functions math.order math.parser math.vectors sbufs
+sequences sequences.private strings tools.test vectors ;
IN: sequences.tests
{ "empty" } [ { } [ "empty" ] [ "not empty" ] if-empty ] unit-test
{ 1 2 3 4 5 6 7 8 } [ H{ { 11 "hi" } } at ] map-find
] unit-test
-USE: make
-
{ { "a" 1 "b" 1 "c" } }
[ 1 { "a" "b" "c" } [ [ dup , ] [ , ] interleave drop ] { } make ] unit-test
! Copyright (C) 2010 Daniel Ehrenberg, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: sets tools.test kernel prettyprint hash-sets sorting
-math sequences bit-sets bit-arrays ;
+USING: bit-arrays bit-sets kernel math sequences sets sorting
+tools.test ;
IN: sets.tests
{ V{ 1 2 3 } } [ 3 V{ 1 2 } clone [ adjoin ] keep ] unit-test
-USING: math accessors slots strings generic.single kernel
-tools.test generic words parser eval math.functions arrays ;
+USING: accessors arrays generic.single kernel math
+math.functions slots tools.test words ;
IN: slots.tests
TUPLE: r/w-test foo ;
-USING: sorting sequences kernel math math.order random
-tools.test vectors sets vocabs grouping ;
-IN: sorting.tests
+USING: grouping kernel math math.order random sequences sets
+sorting tools.test vocabs ;
{ { } } [ { } natural-sort ] unit-test
USING: assocs compiler.errors compiler.units definitions
-namespaces source-files.errors tools.test words ;
+namespaces tools.test words ;
IN: source-files.errors.tests
DEFER: forget-test
-IN: source-files.tests
-USING: source-files tools.test assocs sequences strings
-namespaces kernel ;
+USING: assocs namespaces sequences source-files strings
+tools.test ;
{ { } } [ source-files get keys [ string? ] reject ] unit-test
-USING: splitting tools.test kernel sequences arrays strings ascii math ;
-IN: splitting.tests
+USING: ascii kernel math sequences splitting strings tools.test ;
{ "hello" "world ." } [ "hello world ." " " split1 ] unit-test
{ "hello" "world-+." } [ "hello-+world-+." "-+" split1 ] unit-test
-USING: accessors eval strings.parser strings.parser.private
-tools.test ;
-IN: strings.parser.tests
+USING: eval strings.parser tools.test ;
{ "Hello\n\rworld" } [ "Hello\\n\\rworld" unescape-string ] unit-test
-USING: continuations kernel literals math math.order namespaces make
-strings strings.private sbufs tools.test sequences vectors
-arrays memory prettyprint io.streams.null kernel.private ;
-IN: strings.tests
+USING: arrays continuations io.streams.null kernel
+kernel.private literals make math math.order memory namespaces
+prettyprint sbufs sequences strings strings.private tools.test
+vectors ;
{ CHAR: b } [ 1 >bignum "abc" nth ] unit-test
USING: arrays sequences system tools.test ;
-IN: system.tests
{ { t t t } } [
vm-version vm-compiler vm-compile-time 3array
-USING: accessors arrays kernel kernel.private math namespaces
-sequences sequences.private strings tools.test vectors
-continuations random growable classes ;
-IN: vectors.tests
+USING: accessors arrays classes continuations kernel math
+namespaces random sequences tools.test vectors ;
{ } [ 10 [ [ -1000000 <vector> ] ignore-errors ] times ] unit-test
-USING: vocabs.loader tools.test continuations vocabs math
-kernel arrays sequences namespaces io.streams.string sets
-parser source-files words assocs classes.tuple definitions
-debugger compiler.units accessors eval vocabs.hierarchy
-combinators vocabs.parser grouping vocabs.files vocabs.refresh ;
+USING: accessors compiler.units continuations debugger
+definitions eval io.streams.string kernel math namespaces parser
+prettyprint sequences sets source-files tools.test vocabs
+vocabs.files vocabs.loader vocabs.parser vocabs.refresh words ;
IN: vocabs.loader.tests
! This vocab should not exist, but just in case...
[ t ] [
"resource:core/vocabs/loader/test/a/a.factor"
- path>source-file definitions>> dup USE: prettyprint .
+ path>source-file definitions>>
"v-l-t-a-hello" "vocabs.loader.test.a" lookup-word dup .
swap first in?
] unit-test
+USING: accessors compiler.units definitions eval kernel
+tools.test vocabs vocabs.parser words ;
IN: vocabs.parser.tests
-USING: vocabs.parser tools.test eval kernel accessors definitions
-compiler.units words vocabs ;
[ "FROM: kernel => doesnotexist ;" eval( -- ) ]
[ error>> T{ no-word-in-vocab { word "doesnotexist" } { vocab "kernel" } } = ]
-! Unit tests for vocabs vocabulary
-USING: vocabs tools.test ;
-IN: vocabs.tests
+USING: tools.test vocabs ;
{ f } [ "kernel" vocab-main ] unit-test
-USING: math eval lexer tools.test effects sequences ;
+USING: effects eval math tools.test ;
IN: words.alias.tests
ALIAS: foo +
+USING: math tools.test words.constant ;
IN: words.constant.tests
-USING: tools.test math words.constant ;
CONSTANT: a +
-USING: arrays generic assocs kernel math namespaces
-sequences tools.test words definitions parser quotations
-vocabs continuations classes.tuple compiler.units
-io.streams.string accessors eval words.symbol grouping ;
+USING: accessors arrays compiler.units definitions eval generic
+io.streams.string kernel math namespaces parser sequences
+tools.test vocabs words words.symbol ;
IN: words.tests
{ 4 } [