alpha
Login
or
Join now
nandi.uk
/
gleam
Star
2
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Fork of daniellemaywood.uk/gleam — Wasm codegen work
Star
2
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Handle case where path field is empty
author
John Downey
committer
Louis Pilfold
date
3 weeks ago
(Jul 1, 2026, 2:35 PM +0100)
commit
87a6678b
87a6678b2adc49233e7889e16ee6ed1983e7c75d
parent
ef37f78f
ef37f78fd11d36f677ba21a27e7523802989adfe
+22
2 changed files
Expand all
Collapse all
Unified
Split
compiler-core
src
requirement.rs
snapshots
gleam_core__requirement__tests__read_git_requirement_with_empty_path.snap
+13
compiler-core/src/requirement.rs
View file
Reviewed
···
176
176
path: Some(path), ..
177
177
} = &requirement
178
178
{
179
179
+
if path.as_str().is_empty() {
180
180
+
return Err(de::Error::custom("git dependency path must not be empty"));
181
181
+
}
179
182
crate::io::validate_safe_relative_path(path).map_err(de::Error::custom)?;
180
183
}
181
184
Ok(requirement)
···
225
228
226
229
let error =
227
230
toml::from_str::<HashMap<String, Requirement>>(toml).expect_err("escaping path");
231
231
+
insta::assert_snapshot!(error.to_string());
232
232
+
}
233
233
+
234
234
+
#[test]
235
235
+
fn read_git_requirement_with_empty_path() {
236
236
+
let toml = r#"
237
237
+
monorepo = { git = "https://github.com/gleam-lang/gleam.git", ref = "main", path = "" }
238
238
+
"#;
239
239
+
240
240
+
let error = toml::from_str::<HashMap<String, Requirement>>(toml).expect_err("empty path");
228
241
insta::assert_snapshot!(error.to_string());
229
242
}
230
243
}
+9
compiler-core/src/snapshots/gleam_core__requirement__tests__read_git_requirement_with_empty_path.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: compiler-core/src/requirement.rs
3
3
+
expression: error.to_string()
4
4
+
---
5
5
+
TOML parse error at line 2, column 24
6
6
+
|
7
7
+
2 | monorepo = { git = "https://github.com/gleam-lang/gleam.git", ref = "main", path = "" }
8
8
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9
9
+
git dependency path must not be empty