Skip to content

Commit

Permalink
Revert "factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a…
Browse files Browse the repository at this point in the history
… refactoring tool!"

Needs a bit more work.

This reverts commit 7e54cc2.
  • Loading branch information
erg committed Jul 2, 2015
1 parent 7e54cc2 commit 59f3b1e
Show file tree
Hide file tree
Showing 756 changed files with 12,024 additions and 12,024 deletions.
52 changes: 26 additions & 26 deletions basis/alien/c-types/c-types-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,57 @@ IN: alien.c-types.tests

CONSTANT: xyz 123

{ 492 } [ { int xyz } heap-size ] unit-test
[ 492 ] [ { int xyz } heap-size ] unit-test

UNION-STRUCT: foo
{ a int }
{ b int } ;

{ t } [ pointer: void lookup-c-type void* lookup-c-type = ] unit-test
{ t } [ pointer: int lookup-c-type void* lookup-c-type = ] unit-test
{ t } [ pointer: int* lookup-c-type void* lookup-c-type = ] unit-test
{ f } [ pointer: foo lookup-c-type void* lookup-c-type = ] unit-test
{ t } [ pointer: foo* lookup-c-type void* lookup-c-type = ] unit-test
[ t ] [ pointer: void lookup-c-type void* lookup-c-type = ] unit-test
[ t ] [ pointer: int lookup-c-type void* lookup-c-type = ] unit-test
[ t ] [ pointer: int* lookup-c-type void* lookup-c-type = ] unit-test
[ f ] [ pointer: foo lookup-c-type void* lookup-c-type = ] unit-test
[ t ] [ pointer: foo* lookup-c-type void* lookup-c-type = ] unit-test

{ t } [ c-string lookup-c-type c-string lookup-c-type = ] unit-test
[ t ] [ c-string lookup-c-type c-string lookup-c-type = ] unit-test

{ t } [ foo heap-size int heap-size = ] unit-test
[ t ] [ foo heap-size int heap-size = ] unit-test

TYPEDEF: int MyInt

{ t } [ int lookup-c-type MyInt lookup-c-type = ] unit-test
{ t } [ void* lookup-c-type pointer: MyInt lookup-c-type = ] unit-test
[ t ] [ int lookup-c-type MyInt lookup-c-type = ] unit-test
[ t ] [ void* lookup-c-type pointer: MyInt lookup-c-type = ] unit-test

{ 32 } [ { int 8 } heap-size ] unit-test
[ 32 ] [ { int 8 } heap-size ] unit-test

{ } [ pointer: { int 8 } heap-size pointer: void heap-size assert= ] unit-test
[ ] [ pointer: { int 8 } heap-size pointer: void heap-size assert= ] unit-test

TYPEDEF: char MyChar

{ t } [ pointer: void lookup-c-type pointer: MyChar lookup-c-type = ] unit-test
[ t ] [ pointer: void lookup-c-type pointer: MyChar lookup-c-type = ] unit-test

TYPEDEF: { c-string ascii } MyFunkyString

{ { c-string ascii } } [ MyFunkyString lookup-c-type ] unit-test
[ { c-string ascii } ] [ MyFunkyString lookup-c-type ] unit-test

TYPEDEF: c-string MyString

{ t } [ c-string lookup-c-type MyString lookup-c-type = ] unit-test
{ t } [ void* lookup-c-type pointer: MyString lookup-c-type = ] unit-test
[ t ] [ c-string lookup-c-type MyString lookup-c-type = ] unit-test
[ t ] [ void* lookup-c-type pointer: MyString lookup-c-type = ] unit-test

TYPEDEF: int* MyIntArray

{ t } [ void* lookup-c-type MyIntArray lookup-c-type = ] unit-test
[ t ] [ void* lookup-c-type MyIntArray lookup-c-type = ] unit-test

{ 0 } [ -10 uchar c-type-clamp ] unit-test
{ 12 } [ 12 uchar c-type-clamp ] unit-test
{ -10 } [ -10 char c-type-clamp ] unit-test
{ 127 } [ 230 char c-type-clamp ] unit-test
{ t } [ pi dup float c-type-clamp = ] unit-test
[ 0 ] [ -10 uchar c-type-clamp ] unit-test
[ 12 ] [ 12 uchar c-type-clamp ] unit-test
[ -10 ] [ -10 char c-type-clamp ] unit-test
[ 127 ] [ 230 char c-type-clamp ] unit-test
[ t ] [ pi dup float c-type-clamp = ] unit-test

C-TYPE: opaque

{ t } [ void* lookup-c-type pointer: opaque lookup-c-type = ] unit-test
[ t ] [ void* lookup-c-type pointer: opaque lookup-c-type = ] unit-test
[ opaque lookup-c-type ] [ no-c-type? ] must-fail-with

[ """
Expand All @@ -70,12 +70,12 @@ C-TYPE: forward
STRUCT: backward { x forward* } ;
STRUCT: forward { x backward* } ;

{ t } [ forward lookup-c-type struct-c-type? ] unit-test
{ t } [ backward lookup-c-type struct-c-type? ] unit-test
[ t ] [ forward lookup-c-type struct-c-type? ] unit-test
[ t ] [ backward lookup-c-type struct-c-type? ] unit-test

DEFER: struct-redefined

{ f }
[ f ]
[

"""
Expand Down
8 changes: 4 additions & 4 deletions basis/alien/complex/complex-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ STRUCT: complex-holder
: <complex-holder> ( z -- alien )
complex-holder <struct-boa> ;

{ } [
[ ] [
C{ 1.0 2.0 } <complex-holder> "h" set
] unit-test

{ C{ 1.0 2.0 } } [ "h" get z>> ] unit-test
[ C{ 1.0 2.0 } ] [ "h" get z>> ] unit-test

{ complex } [ complex-float c-type-boxed-class ] unit-test
[ complex ] [ complex-float c-type-boxed-class ] unit-test

{ complex } [ complex-double c-type-boxed-class ] unit-test
[ complex ] [ complex-double c-type-boxed-class ] unit-test
60 changes: 30 additions & 30 deletions basis/alien/data/data-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ system ;
QUALIFIED-WITH: alien.c-types c
IN: alien.data.tests

{ -1 } [ -1 c:char <ref> c:char deref ] unit-test
{ -1 } [ -1 c:short <ref> c:short deref ] unit-test
{ -1 } [ -1 c:int <ref> c:int deref ] unit-test
[ -1 ] [ -1 c:char <ref> c:char deref ] unit-test
[ -1 ] [ -1 c:short <ref> c:short deref ] unit-test
[ -1 ] [ -1 c:int <ref> c:int deref ] unit-test

! I don't care if this throws an error or works, but at least
! it should be consistent between platforms
{ -1 } [ -1.0 c:int <ref> c:int deref ] unit-test
{ -1 } [ -1.0 c:long <ref> c:long deref ] unit-test
{ -1 } [ -1.0 c:longlong <ref> c:longlong deref ] unit-test
{ 1 } [ 1.0 c:uint <ref> c:uint deref ] unit-test
{ 1 } [ 1.0 c:ulong <ref> c:ulong deref ] unit-test
{ 1 } [ 1.0 c:ulonglong <ref> c:ulonglong deref ] unit-test
[ -1 ] [ -1.0 c:int <ref> c:int deref ] unit-test
[ -1 ] [ -1.0 c:long <ref> c:long deref ] unit-test
[ -1 ] [ -1.0 c:longlong <ref> c:longlong deref ] unit-test
[ 1 ] [ 1.0 c:uint <ref> c:uint deref ] unit-test
[ 1 ] [ 1.0 c:ulong <ref> c:ulong deref ] unit-test
[ 1 ] [ 1.0 c:ulonglong <ref> c:ulonglong deref ] unit-test

[
0 B{ 1 2 3 4 } <displaced-alien> c:void* <ref>
Expand All @@ -30,34 +30,34 @@ STRUCT: foo { a c:int } { b c:void* } { c c:bool } ;

SPECIALIZED-ARRAY: foo

{ t } [ 0 binary-zero? ] unit-test
{ f } [ 1 binary-zero? ] unit-test
{ f } [ -1 binary-zero? ] unit-test
{ t } [ 0.0 binary-zero? ] unit-test
{ f } [ 1.0 binary-zero? ] unit-test
{ f } [ -0.0 binary-zero? ] unit-test
{ t } [ C{ 0.0 0.0 } binary-zero? ] unit-test
{ f } [ C{ 1.0 0.0 } binary-zero? ] unit-test
{ f } [ C{ -0.0 0.0 } binary-zero? ] unit-test
{ f } [ C{ 0.0 1.0 } binary-zero? ] unit-test
{ f } [ C{ 0.0 -0.0 } binary-zero? ] unit-test
{ t } [ f binary-zero? ] unit-test
{ t } [ 0 <alien> binary-zero? ] unit-test
{ f } [ 1 <alien> binary-zero? ] unit-test
{ f } [ B{ } binary-zero? ] unit-test
{ t } [ S{ foo f 0 f f } binary-zero? ] unit-test
{ f } [ S{ foo f 1 f f } binary-zero? ] unit-test
{ f } [ S{ foo f 0 ALIEN: 8 f } binary-zero? ] unit-test
{ f } [ S{ foo f 0 f t } binary-zero? ] unit-test
{ t t f } [
[ t ] [ 0 binary-zero? ] unit-test
[ f ] [ 1 binary-zero? ] unit-test
[ f ] [ -1 binary-zero? ] unit-test
[ t ] [ 0.0 binary-zero? ] unit-test
[ f ] [ 1.0 binary-zero? ] unit-test
[ f ] [ -0.0 binary-zero? ] unit-test
[ t ] [ C{ 0.0 0.0 } binary-zero? ] unit-test
[ f ] [ C{ 1.0 0.0 } binary-zero? ] unit-test
[ f ] [ C{ -0.0 0.0 } binary-zero? ] unit-test
[ f ] [ C{ 0.0 1.0 } binary-zero? ] unit-test
[ f ] [ C{ 0.0 -0.0 } binary-zero? ] unit-test
[ t ] [ f binary-zero? ] unit-test
[ t ] [ 0 <alien> binary-zero? ] unit-test
[ f ] [ 1 <alien> binary-zero? ] unit-test
[ f ] [ B{ } binary-zero? ] unit-test
[ t ] [ S{ foo f 0 f f } binary-zero? ] unit-test
[ f ] [ S{ foo f 1 f f } binary-zero? ] unit-test
[ f ] [ S{ foo f 0 ALIEN: 8 f } binary-zero? ] unit-test
[ f ] [ S{ foo f 0 f t } binary-zero? ] unit-test
[ t t f ] [
foo-array{
S{ foo f 0 f f }
S{ foo f 0 f f }
S{ foo f 1 f f }
} [ first binary-zero? ] [ second binary-zero? ] [ third binary-zero? ] tri
] unit-test

{ } [
[ ] [
[
foo specialized-array-vocab forget-vocab
] with-compilation-unit
Expand Down
90 changes: 45 additions & 45 deletions basis/alien/endian/endian-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -59,41 +59,41 @@ CONSTANT: endian-bytes-f0 B{
: endian-test-struct-f0 ( -- obj )
endian-bytes-f0 endian-struct memory>struct ;

{ 0xff00 } [ endian-test-struct-0f a>> ] unit-test
{ -256 } [ endian-test-struct-0f b>> ] unit-test
{ 0x00ff } [ endian-test-struct-0f c>> ] unit-test
{ 0x00ff } [ endian-test-struct-0f d>> ] unit-test

{ 0xff000000 } [ endian-test-struct-0f e>> ] unit-test
{ -16777216 } [ endian-test-struct-0f f>> ] unit-test
{ 0x000000ff } [ endian-test-struct-0f g>> ] unit-test
{ 0x000000ff } [ endian-test-struct-0f h>> ] unit-test

{ 0xff00000000000000 } [ endian-test-struct-0f i>> ] unit-test
{ -72057594037927936 } [ endian-test-struct-0f j>> ] unit-test
{ 0x00000000000000ff } [ endian-test-struct-0f k>> ] unit-test
{ 0x00000000000000ff } [ endian-test-struct-0f l>> ] unit-test


{ 0xff00 } [ endian-test-struct-f0 c>> ] unit-test
{ -256 } [ endian-test-struct-f0 d>> ] unit-test
{ 0x00ff } [ endian-test-struct-f0 a>> ] unit-test
{ 0x00ff } [ endian-test-struct-f0 b>> ] unit-test

{ 0xff000000 } [ endian-test-struct-f0 g>> ] unit-test
{ -16777216 } [ endian-test-struct-f0 h>> ] unit-test
{ 0x000000ff } [ endian-test-struct-f0 e>> ] unit-test
{ 0x000000ff } [ endian-test-struct-f0 f>> ] unit-test

{ 0xff00000000000000 } [ endian-test-struct-f0 k>> ] unit-test
{ -72057594037927936 } [ endian-test-struct-f0 l>> ] unit-test
{ 0x00000000000000ff } [ endian-test-struct-f0 i>> ] unit-test
{ 0x00000000000000ff } [ endian-test-struct-f0 j>> ] unit-test

{ t }
[ 0xff00 ] [ endian-test-struct-0f a>> ] unit-test
[ -256 ] [ endian-test-struct-0f b>> ] unit-test
[ 0x00ff ] [ endian-test-struct-0f c>> ] unit-test
[ 0x00ff ] [ endian-test-struct-0f d>> ] unit-test

[ 0xff000000 ] [ endian-test-struct-0f e>> ] unit-test
[ -16777216 ] [ endian-test-struct-0f f>> ] unit-test
[ 0x000000ff ] [ endian-test-struct-0f g>> ] unit-test
[ 0x000000ff ] [ endian-test-struct-0f h>> ] unit-test

[ 0xff00000000000000 ] [ endian-test-struct-0f i>> ] unit-test
[ -72057594037927936 ] [ endian-test-struct-0f j>> ] unit-test
[ 0x00000000000000ff ] [ endian-test-struct-0f k>> ] unit-test
[ 0x00000000000000ff ] [ endian-test-struct-0f l>> ] unit-test


[ 0xff00 ] [ endian-test-struct-f0 c>> ] unit-test
[ -256 ] [ endian-test-struct-f0 d>> ] unit-test
[ 0x00ff ] [ endian-test-struct-f0 a>> ] unit-test
[ 0x00ff ] [ endian-test-struct-f0 b>> ] unit-test

[ 0xff000000 ] [ endian-test-struct-f0 g>> ] unit-test
[ -16777216 ] [ endian-test-struct-f0 h>> ] unit-test
[ 0x000000ff ] [ endian-test-struct-f0 e>> ] unit-test
[ 0x000000ff ] [ endian-test-struct-f0 f>> ] unit-test

[ 0xff00000000000000 ] [ endian-test-struct-f0 k>> ] unit-test
[ -72057594037927936 ] [ endian-test-struct-f0 l>> ] unit-test
[ 0x00000000000000ff ] [ endian-test-struct-f0 i>> ] unit-test
[ 0x00000000000000ff ] [ endian-test-struct-f0 j>> ] unit-test

[ t ]
[ endian-test-struct-0f binary [ write ] with-byte-writer endian-bytes-0f = ] unit-test

{ t }
[ t ]
[ endian-test-struct-f0 binary [ write ] with-byte-writer endian-bytes-f0 = ] unit-test

LE-STRUCT: le-endian-struct
Expand All @@ -110,13 +110,13 @@ LE-STRUCT: le-endian-struct
{ k ube64 }
{ l be64 } ;

{ t }
[ t ]
[
endian-bytes-0f le-endian-struct memory>struct
binary [ write ] with-byte-writer endian-bytes-0f =
] unit-test

{ t }
[ t ]
[
endian-bytes-f0 le-endian-struct memory>struct
binary [ write ] with-byte-writer endian-bytes-f0 =
Expand All @@ -137,13 +137,13 @@ BE-STRUCT: be-endian-struct
{ k ube64 }
{ l be64 } ;

{ t }
[ t ]
[
endian-bytes-0f be-endian-struct memory>struct
binary [ write ] with-byte-writer endian-bytes-0f =
] unit-test

{ t }
[ t ]
[
endian-bytes-f0 be-endian-struct memory>struct
binary [ write ] with-byte-writer endian-bytes-f0 =
Expand All @@ -163,13 +163,13 @@ LE-STRUCT: le-override-struct
{ k ube64 }
{ l be64 } ;

{ t }
[ t ]
[
endian-bytes-0f le-override-struct memory>struct
binary [ write ] with-byte-writer endian-bytes-0f =
] unit-test

{ t }
[ t ]
[
endian-bytes-f0 le-override-struct memory>struct
binary [ write ] with-byte-writer endian-bytes-f0 =
Expand All @@ -189,13 +189,13 @@ BE-STRUCT: be-override-struct
{ k ulonglong }
{ l longlong } ;

{ t }
[ t ]
[
endian-bytes-0f be-override-struct memory>struct
binary [ write ] with-byte-writer endian-bytes-0f =
] unit-test

{ t }
[ t ]
[
endian-bytes-f0 be-override-struct memory>struct
binary [ write ] with-byte-writer endian-bytes-f0 =
Expand All @@ -206,15 +206,15 @@ LE-PACKED-STRUCT: le-packed-struct
{ a char[7] }
{ b int } ;

{ t }
[ t ]
[
B{ 0 0 0 0 0 0 0 3 0 0 0 } [
le-packed-struct memory>struct
binary [ write ] with-byte-writer
] keep =
] unit-test

{ 3 }
[ 3 ]
[
B{ 0 0 0 0 0 0 0 3 0 0 0 } le-packed-struct memory>struct
b>>
Expand All @@ -225,15 +225,15 @@ BE-PACKED-STRUCT: be-packed-struct
{ a char[7] }
{ b int } ;

{ t }
[ t ]
[
B{ 0 0 0 0 0 0 0 0 0 0 3 } [
be-packed-struct memory>struct
binary [ write ] with-byte-writer
] keep =
] unit-test

{ 3 }
[ 3 ]
[
B{ 0 0 0 0 0 0 0 0 0 0 3 } be-packed-struct memory>struct
b>>
Expand Down
4 changes: 2 additions & 2 deletions basis/alien/enums/enums-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ENUM: instrument_t < ushort trombone trumpet ;

ENUM: colores { rojo red } { verde green } { azul blue } { colorado rojo } ;

{ { 0 3 4 0 } } [ { rojo verde azul colorado } [ enum>number ] map ] unit-test
[ { 0 3 4 0 } ] [ { rojo verde azul colorado } [ enum>number ] map ] unit-test

SYMBOLS: couleurs rouge vert bleu jaune azure ;

Expand All @@ -48,4 +48,4 @@ SYMBOLS: couleurs rouge vert bleu jaune azure ;
{ azure bleu }
} define-enum >>

{ { 0 3 4 14 4 } } [ { rouge vert bleu jaune azure } [ enum>number ] map ] unit-test
[ { 0 3 4 14 4 } ] [ { rouge vert bleu jaune azure } [ enum>number ] map ] unit-test
Loading

0 comments on commit 59f3b1e

Please sign in to comment.