mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
Format
This commit is contained in:
parent
1322f3de9f
commit
590feb1c71
5 changed files with 17 additions and 20 deletions
|
@ -209,8 +209,7 @@ fn v8_set_flags_preprocess(args: Vec<String>) -> (Vec<String>, Vec<String>) {
|
|||
}
|
||||
|
||||
true
|
||||
})
|
||||
.collect();
|
||||
}).collect();
|
||||
|
||||
// Replace args being sent to V8
|
||||
for idx in 0..args.len() {
|
||||
|
@ -279,7 +278,6 @@ pub fn v8_set_flags(args: Vec<String>) -> Vec<String> {
|
|||
let cstr = CStr::from_ptr(*ptr as *const i8);
|
||||
let slice = cstr.to_str().unwrap();
|
||||
slice.to_string()
|
||||
})
|
||||
.chain(rest.into_iter())
|
||||
}).chain(rest.into_iter())
|
||||
.collect()
|
||||
}
|
||||
|
|
|
@ -372,8 +372,7 @@ mod tests {
|
|||
throw Error("assert error");
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.expect("execute error");
|
||||
).expect("execute error");
|
||||
isolate.event_loop();
|
||||
});
|
||||
}
|
||||
|
@ -418,8 +417,7 @@ mod tests {
|
|||
const data = new Uint8Array([42, 43, 44, 45, 46]);
|
||||
libdeno.send(control, data);
|
||||
"#,
|
||||
)
|
||||
.expect("execute error");
|
||||
).expect("execute error");
|
||||
isolate.event_loop();
|
||||
let metrics = isolate.state.metrics.lock().unwrap();
|
||||
assert_eq!(metrics.ops_dispatched, 1);
|
||||
|
@ -455,8 +453,7 @@ mod tests {
|
|||
let r = libdeno.send(control, data);
|
||||
if (r != null) throw Error("expected null");
|
||||
"#,
|
||||
)
|
||||
.expect("execute error");
|
||||
).expect("execute error");
|
||||
|
||||
// Make sure relevant metrics are updated before task is executed.
|
||||
{
|
||||
|
|
12
src/ops.rs
12
src/ops.rs
|
@ -113,7 +113,8 @@ pub fn dispatch(
|
|||
op_creator(isolate.state.clone(), &base, data)
|
||||
};
|
||||
|
||||
let boxed_op = Box::new(op.or_else(move |err: DenoError| -> DenoResult<Buf> {
|
||||
let boxed_op = Box::new(
|
||||
op.or_else(move |err: DenoError| -> DenoResult<Buf> {
|
||||
debug!("op err {}", err);
|
||||
// No matter whether we got an Err or Ok, we want a serialized message to
|
||||
// send back. So transform the DenoError into a deno_buf.
|
||||
|
@ -145,7 +146,8 @@ pub fn dispatch(
|
|||
)
|
||||
};
|
||||
Ok(buf)
|
||||
}));
|
||||
}),
|
||||
);
|
||||
|
||||
debug!(
|
||||
"msg_from_js {} sync {}",
|
||||
|
@ -367,8 +369,7 @@ fn op_env(
|
|||
..Default::default()
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
}).collect();
|
||||
let tables = builder.create_vector(&vars);
|
||||
let inner = msg::EnvironRes::create(
|
||||
builder,
|
||||
|
@ -948,8 +949,7 @@ fn op_read_dir(
|
|||
..Default::default()
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
}).collect();
|
||||
|
||||
let entries = builder.create_vector(&entries);
|
||||
let inner = msg::ReadDirRes::create(
|
||||
|
|
|
@ -6,6 +6,7 @@ import subprocess
|
|||
import sys
|
||||
from util import rmtree, run
|
||||
|
||||
|
||||
def deno_dir_test(deno_exe, deno_dir):
|
||||
assert os.path.isfile(deno_exe)
|
||||
|
||||
|
@ -29,7 +30,7 @@ def deno_dir_test(deno_exe, deno_dir):
|
|||
rmtree(deno_dir)
|
||||
|
||||
if old_deno_dir is not None:
|
||||
os.environ["DENO_DIR"] = old_deno_dir
|
||||
os.environ["DENO_DIR"] = old_deno_dir
|
||||
|
||||
|
||||
def run_deno(deno_exe, deno_dir=None):
|
||||
|
@ -37,6 +38,7 @@ def run_deno(deno_exe, deno_dir=None):
|
|||
deno_dir_env = {"DENO_DIR": deno_dir} if deno_dir is not None else None
|
||||
run(cmd, quiet=True, env=deno_dir_env)
|
||||
|
||||
|
||||
def main(argv):
|
||||
if len(sys.argv) != 3:
|
||||
print "Usage ./tools/deno_dir_test.py out/debug/deno out/debug/.deno_dir"
|
||||
|
|
|
@ -4,6 +4,7 @@ import sys
|
|||
import subprocess
|
||||
import re
|
||||
|
||||
|
||||
def run_unit_test2(cmd):
|
||||
process = subprocess.Popen(
|
||||
cmd,
|
||||
|
@ -26,6 +27,7 @@ def run_unit_test2(cmd):
|
|||
if errcode != 0:
|
||||
sys.exit(errcode)
|
||||
|
||||
|
||||
def run_unit_test(deno_exe, permStr, flags=[]):
|
||||
cmd = [deno_exe, "--reload", "js/unit_tests.ts", permStr] + flags
|
||||
run_unit_test2(cmd)
|
||||
|
@ -48,9 +50,7 @@ def unit_tests(deno_exe):
|
|||
# These are not strictly unit tests for Deno, but for ts_library_builder.
|
||||
# They run under Node, but use the same //js/testing/ library.
|
||||
run_unit_test2([
|
||||
"node",
|
||||
"./node_modules/.bin/ts-node",
|
||||
"--project",
|
||||
"node", "./node_modules/.bin/ts-node", "--project",
|
||||
"tools/ts_library_builder/tsconfig.json",
|
||||
"tools/ts_library_builder/test.ts"
|
||||
])
|
||||
|
|
Loading…
Reference in a new issue