Skip to content

Commit 89d194f

Browse files
committed
more unit tests for cli #700
1 parent f94f2e2 commit 89d194f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/cli.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,25 @@ mod test {
235235
}
236236

237237
#[test]
238-
fn test_fail_config_with_image_protocol_but_no_image() {
238+
fn test_config_with_image_protocol_but_no_image() {
239239
assert!(Config::try_parse_from(&["onefetch", "--image-protocol", "sixel"]).is_err())
240240
}
241241

242+
#[test]
243+
fn test_config_with_color_resolution_but_no_image() {
244+
assert!(Config::try_parse_from(&["onefetch", "--color-resolution", "32"]).is_err())
245+
}
246+
247+
#[test]
248+
fn test_config_with_ascii_colors_but_out_of_bounds() {
249+
assert!(Config::try_parse_from(&["onefetch", "--ascii-colors", "17"]).is_err())
250+
}
251+
252+
#[test]
253+
fn test_config_with_text_colors_but_out_of_bounds() {
254+
assert!(Config::try_parse_from(&["onefetch", "--text-colors", "17"]).is_err())
255+
}
256+
242257
fn get_default_config() -> Config {
243258
Config {
244259
input: PathBuf::from("."),

0 commit comments

Comments
 (0)