nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Nitpretty: make the tool more customizable
[nit.git]
/
lib
/
mnit
/
mnit_injected_input.nit
diff --git
a/lib/mnit/mnit_injected_input.nit
b/lib/mnit/mnit_injected_input.nit
index
feff6ca
..
9d8a819
100644
(file)
--- a/
lib/mnit/mnit_injected_input.nit
+++ b/
lib/mnit/mnit_injected_input.nit
@@
-24,7
+24,7
@@
#
# The input event file is made of event descriptions, one event by line.
#
#
# The input event file is made of event descriptions, one event by line.
#
-# ~~~
+# ~~~raw
# 10 click 10.0 20.0
# 20 quit
# ~~~
# 10 click 10.0 20.0
# 20 quit
# ~~~
@@
-76,12
+76,14
@@
redef class App
redef fun setup
do
var env = "MNIT_SRAND".environ
redef fun setup
do
var env = "MNIT_SRAND".environ
- if env != null and env != "" then
+ if env != "" then
srand_from(env.to_i)
srand_from(env.to_i)
+ else
+ srand_from(0)
end
var input = "MNIT_READ_INPUT".environ
end
var input = "MNIT_READ_INPUT".environ
- if input != null and input != "" then
+ if input != "" then
injected_input_stream = new IFStream.open(input)
print "GET injected_input_stream {input}"
end
injected_input_stream = new IFStream.open(input)
print "GET injected_input_stream {input}"
end
@@
-142,8
+144,9
@@
redef class App
print "UNKNOWN EVENT {fs[1]} (on {l})"
res = true
input(new DummyQuitEvent)
print "UNKNOWN EVENT {fs[1]} (on {l})"
res = true
input(new DummyQuitEvent)
+ return true
end
end
- print "WAIT {wait_next_input} for {next_input}"
+ print "WAIT {wait_next_input} for {next_input.to_s}"
end
end
end
end
end
end