I run the test 3 different ways with different results:
1.) Running the tests from a Cygwin shell window works fine
2.) Running the tests from an xterm fails as mentioned before fails with:
Error: Posix regexp ([--
Everything is hung at this point, Control-C doesn't work, xterm has
to be closed. I think the Control-C signals issue is just a general
cygwin problem unrelated to scsh so I'm not worried about that.
3.) When I run in an Emacs shell buffer I can reproduce the error
without hanging so I have more information now on the problem.
The full error reported in Emacs is:
Error: Posix regexp ([^A-^_-\237]) : invalid character range
#{Regexp}
but the ^A, ^_, and \237 are all actual control characters such as
Control-A. I'm guessing this is what causes the xterm output to choke.
Martin Gasbichler writes:
> The test case is defined in
>
> scsh/test/pattern-matching-test.scm:261
>
> On of the (string-match ...) expressions will produce the error but I
> cannot predict which one.
The problem expression is:
(equal? "\n"
(match:substring (string-match (rx control) test-string)))
I did some experimentation and the problem is control. If I try "\n"
with whitespace it does not give an error (although it gives false of
course), conversely if I try matching "D" against control it fails
withthe same error.
> Could you please try to identify the expression that causes the error
> and post the complete error message and send the output of ,debug and
> ,preview ?
bigred:~/scsh-0.6.7 $ ./go
Welcome to scsh 0.6.7 (RC 1)
Type ,? for help.
> (define test-string
"Dieser Test-String wurde am 29.07.2004 um 5:23PM erstellt.\na aa aaa
aaaa\nab aabb aaabbb\naba abba abbba\n1 12 123 1234\nyyyyyyyyyy\n")
> (define eq-match?
(lambda (m1 m2)
(if (equal? m1 #f)
(not m2)
(and (= (match:start m1)
(match:start m2))
(= (match:end m1)
(match:end m2))
(equal? (match:substring m1)
(match:substring m2))))))
> (equal? "\n"
(match:substring (string-match (rx control) test-string)))
Error: Posix regexp ([^A-^_-\237]) : invalid character range
#{Regexp}
1> ,debug
,debug
'#{Exception-continuation (pc 294) (regexp-compiled in posix-regexps)}
[0: message] "invalid character range"
[1: compiled] 11
[2: temp##545] #f
[3: regexp] '#{Regexp}
inspect: q
q
'#{Exception-continuation (pc 294) (regexp-compiled in posix-regexps)}
1> ,preview
,preview
regexp-compiled in posix-regexps
regexp-match in posix-regexps
cre-search in re-level-0
unnamed
evaluate-and-select in command-processor
loop
thread-start in thread-top-level in threads
1> ,reset
,reset
Top level
>
Given that the test passes in the Cygwin shell and fails in an xterm,
Emacs, this seems to be more of a cygwin issue than a scsh issue.
-bri
|