Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ packages = ["svm-rs-builds"]
#[test]
fn missing_config() {
let config = Config::load_from(Path::new("/nonexistent/config.toml"));
assert!(config.directories.is_empty());
assert!(config.packages.is_empty());
assert_eq!([] as [PathBuf; 0], config.directories.as_slice());
assert_eq!([] as [String; 0], config.packages.as_slice());
}

#[test]
Expand All @@ -161,8 +161,8 @@ packages = ["svm-rs-builds"]
write(&path_buf, "").unwrap();

let config = Config::load_from(&path_buf);
assert!(config.directories.is_empty());
assert!(config.packages.is_empty());
assert_eq!([] as [PathBuf; 0], config.directories.as_slice());
assert_eq!([] as [String; 0], config.packages.as_slice());
}

#[test]
Expand All @@ -179,7 +179,7 @@ packages = ["foo"]
.unwrap();

let config = Config::load_from(&path_buf);
assert!(config.directories.is_empty());
assert_eq!([] as [PathBuf; 0], config.directories.as_slice());
assert_eq!(config.packages, vec!["foo"]);
}

Expand All @@ -198,7 +198,7 @@ directories = ["/tmp/myproject"]

let config = Config::load_from(&path_buf);
assert_eq!(config.directories, vec![PathBuf::from("/tmp/myproject")]);
assert!(config.packages.is_empty());
assert_eq!([] as [String; 0], config.packages.as_slice());
}

#[test]
Expand All @@ -215,7 +215,7 @@ packages = ["foo"]
.unwrap();

let config = Config::load_from(&path_buf);
assert!(config.packages.is_empty());
assert_eq!([] as [String; 0], config.packages.as_slice());
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/util/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn split_escaped(mut s: &str) -> Result<Vec<String>> {
let mut v = vec![String::new()];

while let Some(i) = s.find(|c: char| c.is_ascii_whitespace() || c == '\\') {
debug_assert!(!v.is_empty());
debug_assert_ne!([] as [String; 0], v.as_slice());
// smoelius: Only the last string in `v` can be empty.
debug_assert!(
v.iter()
Expand Down
78 changes: 18 additions & 60 deletions tests/supply_chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
}
],
"cfg-if": [
{
"id": 11,
"kind": "team",
"login": "github:rust-lang:libs",
"name": "libs"
},
{
"id": 55123,
"kind": "user",
Expand Down Expand Up @@ -201,42 +195,6 @@
}
],
"libc": [
{
"id": 3,
"kind": "user",
"login": "huonw",
"name": "Huon Wilson"
},
{
"id": 11,
"kind": "team",
"login": "github:rust-lang:libs",
"name": "libs"
},
{
"id": 3623,
"kind": "team",
"login": "github:rust-lang:libc",
"name": "libc"
},
{
"id": 4333,
"kind": "user",
"login": "joshtriplett",
"name": "Josh Triplett"
},
{
"id": 5725,
"kind": "user",
"login": "gnzlbg",
"name": "gnzlbg"
},
{
"id": 51017,
"kind": "user",
"login": "JohnTitor",
"name": "Yuki Okushi"
},
{
"id": 55123,
"kind": "user",
Expand Down Expand Up @@ -271,12 +229,6 @@
"login": "github:rust-lang-nursery:log-owners",
"name": "log-owners"
},
{
"id": 51,
"kind": "team",
"login": "github:rust-lang-nursery:libs",
"name": "libs"
},
{
"id": 3204,
"kind": "user",
Expand Down Expand Up @@ -345,12 +297,6 @@
}
],
"regex": [
{
"id": 11,
"kind": "team",
"login": "github:rust-lang:libs",
"name": "libs"
},
{
"id": 19,
"kind": "team",
Expand All @@ -362,6 +308,12 @@
"kind": "user",
"login": "BurntSushi",
"name": "Andrew Gallant"
},
{
"id": 55123,
"kind": "user",
"login": "rust-lang-owner",
"name": null
}
],
"regex-automata": [
Expand All @@ -370,15 +322,15 @@
"kind": "user",
"login": "BurntSushi",
"name": "Andrew Gallant"
},
{
"id": 55123,
"kind": "user",
"login": "rust-lang-owner",
"name": null
}
],
"regex-syntax": [
{
"id": 11,
"kind": "team",
"login": "github:rust-lang:libs",
"name": "libs"
},
{
"id": 19,
"kind": "team",
Expand All @@ -390,6 +342,12 @@
"kind": "user",
"login": "BurntSushi",
"name": "Andrew Gallant"
},
{
"id": 55123,
"kind": "user",
"login": "rust-lang-owner",
"name": null
}
],
"rustix": [
Expand Down
Loading