More fixes

db4
Slava Pestov 2008-06-25 04:06:18 -05:00
parent cf345df3f5
commit 666d4abaee
9 changed files with 24 additions and 27 deletions

View File

@ -198,7 +198,7 @@ IN: parser.tests
[
"IN: parser.tests : x ; : y 3 throw ; this is an error"
<string-reader> "a" parse-stream
] [ parse-error? ] must-fail-with
] [ source-file-error? ] must-fail-with
[ t ] [
"y" "parser.tests" lookup >boolean
@ -298,12 +298,12 @@ IN: parser.tests
[
"IN: parser.tests TUPLE: another-pred-test ; GENERIC: another-pred-test?"
<string-reader> "removing-the-predicate" parse-stream
] [ error>> error>> redefine-error? ] must-fail-with
] [ error>> error>> error>> redefine-error? ] must-fail-with
[
"IN: parser.tests TUPLE: class-redef-test ; TUPLE: class-redef-test ;"
<string-reader> "redefining-a-class-1" parse-stream
] [ error>> error>> redefine-error? ] must-fail-with
] [ error>> error>> error>> redefine-error? ] must-fail-with
[ ] [
"IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test"
@ -313,7 +313,7 @@ IN: parser.tests
[
"IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test : class-redef-test ;"
<string-reader> "redefining-a-class-3" parse-stream drop
] [ error>> error>> redefine-error? ] must-fail-with
] [ error>> error>> error>> redefine-error? ] must-fail-with
[ ] [
"IN: parser.tests TUPLE: class-fwd-test ;"
@ -323,7 +323,7 @@ IN: parser.tests
[
"IN: parser.tests \\ class-fwd-test"
<string-reader> "redefining-a-class-3" parse-stream drop
] [ error>> error>> no-word-error? ] must-fail-with
] [ error>> error>> error>> no-word-error? ] must-fail-with
[ ] [
"IN: parser.tests TUPLE: class-fwd-test ; SYMBOL: class-fwd-test"
@ -333,12 +333,12 @@ IN: parser.tests
[
"IN: parser.tests \\ class-fwd-test"
<string-reader> "redefining-a-class-3" parse-stream drop
] [ error>> error>> no-word-error? ] must-fail-with
] [ error>> error>> error>> no-word-error? ] must-fail-with
[
"IN: parser.tests : foo ; TUPLE: foo ;"
<string-reader> "redefining-a-class-4" parse-stream drop
] [ error>> error>> redefine-error? ] must-fail-with
] [ error>> error>> error>> redefine-error? ] must-fail-with
[ ] [
"IN: parser.tests : foo ( x y -- z ) 1 2 ; : bar ( a -- b ) ;" eval

View File

@ -24,12 +24,8 @@ t parser-notes set-global
: note. ( str -- )
parser-notes? [
file get file.
lexer get [
lexer-line number>string print
] [
nl
] if*
file get [ file. ] when*
lexer get line>> number>string write ": " write
"Note: " write dup print
] when drop ;

View File

@ -167,9 +167,11 @@ unit-test
"another-retain-layout" another-retain-layout-test check-see
] unit-test
DEFER: parse-error-file
: another-soft-break-test
{
"USING: namespaces parser sequences ;"
"USING: namespaces sequences ;"
"IN: prettyprint.tests"
": another-soft-break-layout ( node -- quot )"
" parse-error-file"
@ -183,7 +185,7 @@ unit-test
: string-layout
{
"USING: io kernel parser ;"
"USING: io kernel lexer ;"
"IN: prettyprint.tests"
": string-layout-test ( error -- )"
" \"Expected \" write dup unexpected-want expected>string write"

View File

@ -82,11 +82,10 @@ TUPLE: source-file-error file error ;
file get >>file
swap >>error ;
: file. ( file -- ) path>> <pathname> pprint ;
: file. ( file -- ) path>> <pathname> . ;
M: source-file-error error.
"Error while parsing " write
[ file>> file. nl ] [ error>> error. ] bi ;
[ file>> file. ] [ error>> error. ] bi ;
M: source-file-error summary
error>> summary ;

View File

@ -68,7 +68,7 @@ IN: vocabs.loader.tests
<string-reader>
"resource:core/vocabs/loader/test/a/a.factor"
parse-stream
] [ error>> error>> no-word-error? ] must-fail-with
] [ error>> error>> error>> no-word-error? ] must-fail-with
0 "count-me" set-global

View File

@ -1,8 +1,8 @@
USING: http tools.test multiline tuple-syntax
io.streams.string io.encodings.utf8 io.encodings.string
kernel arrays splitting sequences
assocs io.sockets db db.sqlite continuations urls hashtables
accessors ;
USING: http tools.test multiline tuple-syntax io.streams.string
io.encodings.utf8 io.encodings.8-bit io.encodings.binary
io.encodings.string kernel arrays splitting sequences assocs
io.sockets db db.sqlite continuations urls hashtables accessors
;
IN: http.tests
[ "text/plain" latin1 ] [ "text/plain" parse-content-type ] unit-test

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: kernel opengl.gl alien.c-types continuations namespaces
assocs alien alien.strings libc opengl math sequences combinators
macros arrays io.encodings.ascii ;
combinators.lib macros arrays io.encodings.ascii ;
IN: opengl.shaders
: with-gl-shader-source-ptr ( string quot -- )

View File

@ -17,7 +17,7 @@ IN: unicode.collation.tests
: test-equality
{ primary= secondary= tertiary= quaternary= }
[ execute ] 2with each ;
[ execute ] with with each ;
[ f f f f ] [ "hello" "hi" test-equality ] unit-test
[ t f f f ] [ "hello" "h\u0000e9llo" test-equality ] unit-test

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Doug Coleman.
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: math.ranges sequences random accessors
USING: math.ranges sequences random accessors combinators.lib
kernel namespaces fry db.types db.tuples urls validators
html.components html.forms http http.server.dispatchers furnace
furnace.actions furnace.boilerplate furnace.redirection ;