mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
Clippy in tests (#10394)
Running `cargo clippy --workspace --tests` We should move that to CI as well
This commit is contained in:
parent
a9a82de5c4
commit
19d732f313
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -49,6 +49,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
run: cargo clippy --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- $CLIPPY_OPTIONS
|
run: cargo clippy --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- $CLIPPY_OPTIONS
|
||||||
|
|
||||||
|
# In tests we don't have to deny unwrap
|
||||||
|
- name: Clippy of tests
|
||||||
|
run: cargo clippy --tests --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- -D warnings
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -215,9 +215,7 @@ mod regex {
|
|||||||
#[test]
|
#[test]
|
||||||
fn parse_handles_external_stream_chunking() {
|
fn parse_handles_external_stream_chunking() {
|
||||||
Playground::setup("parse_test_streaming_1", |dirs, sandbox| {
|
Playground::setup("parse_test_streaming_1", |dirs, sandbox| {
|
||||||
let data: String = std::iter::repeat("abcdefghijklmnopqrstuvwxyz")
|
let data: String = "abcdefghijklmnopqrstuvwxyz".repeat(1000);
|
||||||
.take(1000)
|
|
||||||
.collect();
|
|
||||||
sandbox.with_files(vec![Stub::FileWithContent("data.txt", &data)]);
|
sandbox.with_files(vec![Stub::FileWithContent("data.txt", &data)]);
|
||||||
|
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
|
@ -12,8 +12,8 @@ fn adjust_canonicalization<P: AsRef<Path>>(p: P) -> String {
|
|||||||
fn adjust_canonicalization<P: AsRef<Path>>(p: P) -> String {
|
fn adjust_canonicalization<P: AsRef<Path>>(p: P) -> String {
|
||||||
const VERBATIM_PREFIX: &str = r#"\\?\"#;
|
const VERBATIM_PREFIX: &str = r#"\\?\"#;
|
||||||
let p = p.as_ref().display().to_string();
|
let p = p.as_ref().display().to_string();
|
||||||
if p.starts_with(VERBATIM_PREFIX) {
|
if let Some(stripped) = p.strip_prefix(VERBATIM_PREFIX) {
|
||||||
p[VERBATIM_PREFIX.len()..].to_string()
|
stripped.to_string()
|
||||||
} else {
|
} else {
|
||||||
p
|
p
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user