Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CLI entry point #2157

Merged
merged 14 commits into from
Apr 21, 2019
Prev Previous commit
Next Next commit
additional test case for DenoFlags
  • Loading branch information
bartlomieju committed Apr 21, 2019
commit aedd90fe7fd6a4efa07fc8f1e9309f7051ce495f
21 changes: 21 additions & 0 deletions cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,25 @@ mod tests {
}
)
}

#[test]
fn test_set_flags_10() {
// notice that flags passed after script name will not
// be parsed to DenoFlags but instead forwarded to
// script args as Deno.args
let flags = flags_from_vec(svec![
"deno",
"--allow-write",
"script.ts",
"-D",
"--allow-net"
]);
assert_eq!(
flags,
DenoFlags {
allow_write: true,
..DenoFlags::default()
}
)
}
}