mirror of
https://github.com/janet-lang/janet
synced 2024-06-13 17:06:49 +00:00
Remove some checking code for iocp events.
Be more permissive abouts events we get.
This commit is contained in:
parent
eea8aa555f
commit
2ea90334a3
|
@ -1525,7 +1525,6 @@ void janet_loop1_impl(int has_timeout, JanetTimestamp to) {
|
||||||
} else {
|
} else {
|
||||||
/* Normal event */
|
/* Normal event */
|
||||||
JanetStream *stream = (JanetStream *) completionKey;
|
JanetStream *stream = (JanetStream *) completionKey;
|
||||||
janet_assert(stream->handle != INVALID_HANDLE_VALUE, "got closed stream event");
|
|
||||||
JanetListenerState *state = NULL;
|
JanetListenerState *state = NULL;
|
||||||
if (stream->read_state && stream->read_state->tag == overlapped) {
|
if (stream->read_state && stream->read_state->tag == overlapped) {
|
||||||
state = stream->read_state;
|
state = stream->read_state;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
# Subprocess
|
# Subprocess
|
||||||
# 5e1a8c86f
|
# 5e1a8c86f
|
||||||
(def janet (dyn :executable))
|
(def janet (dyn *executable*))
|
||||||
|
|
||||||
# Subprocess should inherit the "RUN" parameter for fancy testing
|
# Subprocess should inherit the "RUN" parameter for fancy testing
|
||||||
(def run (filter next (string/split " " (os/getenv "SUBRUN" ""))))
|
(def run (filter next (string/split " " (os/getenv "SUBRUN" ""))))
|
||||||
|
@ -205,7 +205,8 @@
|
||||||
(test-echo "world")
|
(test-echo "world")
|
||||||
(test-echo (string/repeat "abcd" 200))
|
(test-echo (string/repeat "abcd" 200))
|
||||||
|
|
||||||
(:close s))
|
(:close s)
|
||||||
|
(gccollect))
|
||||||
|
|
||||||
# Test on both server and client
|
# Test on both server and client
|
||||||
# 504411e
|
# 504411e
|
||||||
|
@ -344,5 +345,25 @@
|
||||||
(ev/go |(ev/chan-close ch))
|
(ev/go |(ev/chan-close ch))
|
||||||
(assert (= (ev/select [ch 1]) [:close ch]))
|
(assert (= (ev/select [ch 1]) [:close ch]))
|
||||||
|
|
||||||
(end-suite)
|
# ev/gather check
|
||||||
|
(defn exec-slurp
|
||||||
|
"Read stdout of subprocess and return it trimmed in a string."
|
||||||
|
[& args]
|
||||||
|
(def env (os/environ))
|
||||||
|
(put env :out :pipe)
|
||||||
|
(def proc (os/spawn args :epx env))
|
||||||
|
(def out (get proc :out))
|
||||||
|
(def buf @"")
|
||||||
|
(ev/gather
|
||||||
|
(:read out :all buf)
|
||||||
|
(:wait proc))
|
||||||
|
(string/trimr buf))
|
||||||
|
(assert-no-error
|
||||||
|
"ev/with-deadline 1"
|
||||||
|
(assert (= "hi"
|
||||||
|
(ev/with-deadline
|
||||||
|
10
|
||||||
|
(exec-slurp janet "-e" "(print :hi)")))
|
||||||
|
"exec-slurp 1"))
|
||||||
|
|
||||||
|
(end-suite)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user