Skip to content

Commit 079ffa3

Browse files
committed
Correctly parse commands for rusti
Closes #7120
1 parent a90fffe commit 079ffa3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/librusti/rusti.rc

+11-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ pub fn run_line(repl: &mut Repl, in: @io::Reader, out: @io::Writer, line: ~str,
424424
use std::iterator::IteratorUtil;
425425

426426
// drop the : and the \n (one byte each)
427-
let full = line.slice(1, line.len() - 1);
427+
let full = line.slice(1, line.len());
428428
let split: ~[~str] = full.word_iter().transform(|s| s.to_owned()).collect();
429429
let len = split.len();
430430

@@ -649,4 +649,14 @@ mod tests {
649649
f()
650650
");
651651
}
652+
653+
#[test]
654+
fn exit_quits() {
655+
let mut r = repl();
656+
assert!(r.running);
657+
let result = run_line(&mut r, io::stdin(), io::stdout(),
658+
~":exit", false);
659+
assert!(result.is_none());
660+
assert!(!r.running);
661+
}
652662
}

0 commit comments

Comments
 (0)