"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cli/tests/integration/repl_tests.rs" between
deno-1.12.0.tar.gz and deno-1.12.1.tar.gz

About: Deno is is a simple, modern and secure runtime for JavaScript and TypeScript that uses the V8 JavaScript engine and is built in Rust.

repl_tests.rs  (deno-1.12.0):repl_tests.rs  (deno-1.12.1)
skipping to change at line 17 skipping to change at line 17
fn pty_multiline() { fn pty_multiline() {
use std::io::{Read, Write}; use std::io::{Read, Write};
run_pty_test(|master| { run_pty_test(|master| {
master.write_all(b"(\n1 + 2\n)\n").unwrap(); master.write_all(b"(\n1 + 2\n)\n").unwrap();
master.write_all(b"{\nfoo: \"foo\"\n}\n").unwrap(); master.write_all(b"{\nfoo: \"foo\"\n}\n").unwrap();
master.write_all(b"`\nfoo\n`\n").unwrap(); master.write_all(b"`\nfoo\n`\n").unwrap();
master.write_all(b"`\n\\`\n`\n").unwrap(); master.write_all(b"`\n\\`\n`\n").unwrap();
master.write_all(b"'{'\n").unwrap(); master.write_all(b"'{'\n").unwrap();
master.write_all(b"'('\n").unwrap(); master.write_all(b"'('\n").unwrap();
master.write_all(b"'['\n").unwrap(); master.write_all(b"'['\n").unwrap();
master.write_all(b"/{/'\n").unwrap(); master.write_all(b"/{/\n").unwrap();
master.write_all(b"/(/'\n").unwrap(); master.write_all(b"/\\(/\n").unwrap();
master.write_all(b"/[/'\n").unwrap(); master.write_all(b"/\\[/\n").unwrap();
master.write_all(b"console.log(\"{test1} abc {test2} def {{test3}}\".match(/ {([^{].+?)}/));\n").unwrap(); master.write_all(b"console.log(\"{test1} abc {test2} def {{test3}}\".match(/ {([^{].+?)}/));\n").unwrap();
master.write_all(b"close();\n").unwrap(); master.write_all(b"close();\n").unwrap();
let mut output = String::new(); let mut output = String::new();
master.read_to_string(&mut output).unwrap(); master.read_to_string(&mut output).unwrap();
assert!(output.contains('3')); assert!(output.contains('3'));
assert!(output.contains("{ foo: \"foo\" }")); assert!(output.contains("{ foo: \"foo\" }"));
assert!(output.contains("\"\\nfoo\\n\"")); assert!(output.contains("\"\\nfoo\\n\""));
assert!(output.contains("\"\\n`\\n\"")); assert!(output.contains("\"\\n`\\n\""));
assert!(output.contains("\"{\"")); assert!(output.contains("\"{\""));
assert!(output.contains("\"(\"")); assert!(output.contains("\"(\""));
assert!(output.contains("\"[\"")); assert!(output.contains("\"[\""));
assert!(output.contains("/{/")); assert!(output.contains("/{/"));
assert!(output.contains("/(/")); assert!(output.contains("/\\(/"));
assert!(output.contains("/{/")); assert!(output.contains("/\\[/"));
assert!(output.contains("[ \"{test1}\", \"test1\" ]")); assert!(output.contains("[ \"{test1}\", \"test1\" ]"));
}); });
} }
#[cfg(unix)] #[cfg(unix)]
#[test] #[test]
fn pty_unpaired_braces() { fn pty_unpaired_braces() {
use std::io::{Read, Write}; use std::io::{Read, Write};
run_pty_test(|master| { run_pty_test(|master| {
master.write_all(b")\n").unwrap(); master.write_all(b")\n").unwrap();
skipping to change at line 76 skipping to change at line 76
let mut output = String::new(); let mut output = String::new();
master.read_to_string(&mut output).unwrap(); master.read_to_string(&mut output).unwrap();
assert!(output.contains("Unterminated string literal")); assert!(output.contains("Unterminated string literal"));
}); });
} }
#[cfg(unix)] #[cfg(unix)]
#[test] #[test]
fn pty_syntax_error_input() {
use std::io::{Read, Write};
run_pty_test(|master| {
master.write_all(b"('\\u')\n").unwrap();
master.write_all(b"('\n").unwrap();
master.write_all(b"close();\n").unwrap();
let mut output = String::new();
master.read_to_string(&mut output).unwrap();
assert!(output.contains("Unterminated string constant"));
assert!(output.contains("Unexpected eof"));
});
}
#[cfg(unix)]
#[test]
fn pty_complete_symbol() { fn pty_complete_symbol() {
use std::io::{Read, Write}; use std::io::{Read, Write};
run_pty_test(|master| { run_pty_test(|master| {
master.write_all(b"Symbol.it\t\n").unwrap(); master.write_all(b"Symbol.it\t\n").unwrap();
master.write_all(b"close();\n").unwrap(); master.write_all(b"close();\n").unwrap();
let mut output = String::new(); let mut output = String::new();
master.read_to_string(&mut output).unwrap(); master.read_to_string(&mut output).unwrap();
assert!(output.contains("Symbol(Symbol.iterator)")); assert!(output.contains("Symbol(Symbol.iterator)"));
 End of changes. 3 change blocks. 
5 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)