Showing the changes to git-pathspec (1 of 100 files). Show all
Unified · Split
| @@ -266,11 +266,7 @@ mod parse { · 265 unmodified lines | ||
| 266 | 266 | fn empty_input() { |
| 267 | 267 | let input = ""; |
| 268 | 268 | |
| 269 | − assert!( | |
| 270 | − !check_against_baseline(input), | |
| 271 | − "This pathspec is valid in git: {}", | |
| 272 | − input | |
| 273 | − ); | |
| 269 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 274 | 270 | |
| 275 | 271 | let output = git_pathspec::parse(input.as_bytes()); |
| 276 | 272 | assert!(output.is_err()); |
| @@ -285,11 +281,7 @@ mod parse { · 8 unmodified lines | ||
| 285 | 281 | ]; |
| 286 | 282 | |
| 287 | 283 | for input in inputs.into_iter() { |
| 288 | − assert!( | |
| 289 | − !check_against_baseline(input), | |
| 290 | − "This pathspec is valid in git: {}", | |
| 291 | − input | |
| 292 | − ); | |
| 284 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 293 | 285 | |
| 294 | 286 | let output = git_pathspec::parse(input.as_bytes()); |
| 295 | 287 | assert!(output.is_err()); |
| @@ -307,11 +299,7 @@ mod parse { · 11 unmodified lines | ||
| 307 | 299 | ]; |
| 308 | 300 | |
| 309 | 301 | for input in inputs.into_iter() { |
| 310 | − assert!( | |
| 311 | − !check_against_baseline(input), | |
| 312 | − "This pathspec is valid in git: {}", | |
| 313 | − input | |
| 314 | − ); | |
| 302 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 315 | 303 | |
| 316 | 304 | let output = git_pathspec::parse(input.as_bytes()); |
| 317 | 305 | assert!(output.is_err()); |
| @@ -329,14 +317,10 @@ mod parse { · 11 unmodified lines | ||
| 329 | 317 | ]; |
| 330 | 318 | |
| 331 | 319 | for input in inputs { |
| 332 | − assert!( | |
| 333 | − !check_against_baseline(input), | |
| 334 | − "This pathspec is valid in git: {}", | |
| 335 | − input | |
| 336 | − ); | |
| 320 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 337 | 321 | |
| 338 | 322 | let output = git_pathspec::parse(input.as_bytes()); |
| 339 | − assert!(output.is_err(), "This pathspec did not produce an error {}", input); | |
| 323 | + assert!(output.is_err(), "This pathspec did not produce an error {input}"); | |
| 340 | 324 | assert!(matches!(output.unwrap_err(), Error::InvalidAttribute { .. })); |
| 341 | 325 | } |
| 342 | 326 | } |
| @@ -355,18 +339,13 @@ mod parse { · 12 unmodified lines | ||
| 355 | 339 | ]; |
| 356 | 340 | |
| 357 | 341 | for input in inputs { |
| 358 | − assert!( | |
| 359 | − !check_against_baseline(input), | |
| 360 | − "This pathspec is valid in git: {}", | |
| 361 | − input | |
| 362 | − ); | |
| 342 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 363 | 343 | |
| 364 | 344 | let output = git_pathspec::parse(input.as_bytes()); |
| 365 | − assert!(output.is_err(), "This pathspec did not produce an error {}", input); | |
| 345 | + assert!(output.is_err(), "This pathspec did not produce an error {input}"); | |
| 366 | 346 | assert!( |
| 367 | 347 | matches!(output.unwrap_err(), Error::InvalidAttributeValue { .. }), |
| 368 | − "Errors did not match for pathspec: {}", | |
| 369 | − input | |
| 348 | + "Errors did not match for pathspec: {input}" | |
| 370 | 349 | ); |
| 371 | 350 | } |
| 372 | 351 | } |
| @@ -380,14 +359,10 @@ mod parse { · 7 unmodified lines | ||
| 380 | 359 | ]; |
| 381 | 360 | |
| 382 | 361 | for input in inputs { |
| 383 | − assert!( | |
| 384 | − !check_against_baseline(input), | |
| 385 | − "This pathspec is valid in git: {}", | |
| 386 | − input | |
| 387 | − ); | |
| 362 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 388 | 363 | |
| 389 | 364 | let output = git_pathspec::parse(input.as_bytes()); |
| 390 | − assert!(output.is_err(), "This pathspec did not produce an error {}", input); | |
| 365 | + assert!(output.is_err(), "This pathspec did not produce an error {input}"); | |
| 391 | 366 | assert!(matches!(output.unwrap_err(), Error::TrailingEscapeCharacter)); |
| 392 | 367 | } |
| 393 | 368 | } |
| @@ -396,11 +371,7 @@ mod parse { · 2 unmodified lines | ||
| 396 | 371 | fn empty_attribute_specification() { |
| 397 | 372 | let input = ":(attr:)"; |
| 398 | 373 | |
| 399 | − assert!( | |
| 400 | − !check_against_baseline(input), | |
| 401 | − "This pathspec is valid in git: {}", | |
| 402 | − input | |
| 403 | − ); | |
| 374 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 404 | 375 | |
| 405 | 376 | let output = git_pathspec::parse(input.as_bytes()); |
| 406 | 377 | assert!(output.is_err()); |
| @@ -411,11 +382,7 @@ mod parse { · 4 unmodified lines | ||
| 411 | 382 | fn multiple_attribute_specifications() { |
| 412 | 383 | let input = ":(attr:one,attr:two)some/path"; |
| 413 | 384 | |
| 414 | − assert!( | |
| 415 | − !check_against_baseline(input), | |
| 416 | − "This pathspec is valid in git: {}", | |
| 417 | − input | |
| 418 | − ); | |
| 385 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 419 | 386 | |
| 420 | 387 | let output = git_pathspec::parse(input.as_bytes()); |
| 421 | 388 | assert!(output.is_err()); |
| @@ -426,11 +393,7 @@ mod parse { · 4 unmodified lines | ||
| 426 | 393 | fn missing_parentheses() { |
| 427 | 394 | let input = ":(top"; |
| 428 | 395 | |
| 429 | − assert!( | |
| 430 | − !check_against_baseline(input), | |
| 431 | − "This pathspec is valid in git: {}", | |
| 432 | − input | |
| 433 | − ); | |
| 396 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 434 | 397 | |
| 435 | 398 | let output = git_pathspec::parse(input.as_bytes()); |
| 436 | 399 | assert!(output.is_err()); |
| @@ -441,11 +404,7 @@ mod parse { · 4 unmodified lines | ||
| 441 | 404 | fn glob_and_literal_keywords_present() { |
| 442 | 405 | let input = ":(glob,literal)some/path"; |
| 443 | 406 | |
| 444 | − assert!( | |
| 445 | − !check_against_baseline(input), | |
| 446 | − "This pathspec is valid in git: {}", | |
| 447 | − input | |
| 448 | − ); | |
| 407 | + assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}"); | |
| 449 | 408 | |
| 450 | 409 | let output = git_pathspec::parse(input.as_bytes()); |
| 451 | 410 | assert!(output.is_err()); |
| @@ -457,14 +416,13 @@ mod parse { · 5 unmodified lines | ||
| 457 | 416 | for (input, expected) in inputs.into_iter() { |
| 458 | 417 | assert!( |
| 459 | 418 | check_against_baseline(input), |
| 460 | − "This pathspec is invalid in git: {}", | |
| 461 | − input | |
| 419 | + "This pathspec is invalid in git: {input}" | |
| 462 | 420 | ); |
| 463 | 421 | |
| 464 | 422 | let pattern: PatternForTesting = git_pathspec::parse(input.as_bytes()) |
| 465 | − .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {}", input)) | |
| 423 | + .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {input}")) | |
| 466 | 424 | .into(); |
| 467 | − assert_eq!(pattern, expected, "while checking input: \"{}\"", input); | |
| 425 | + assert_eq!(pattern, expected, "while checking input: \"{input}\""); | |
| 468 | 426 | } |
| 469 | 427 | } |
| 470 | 428 | |
| @@ -509,7 +467,7 @@ mod parse { · 38 unmodified lines | ||
| 509 | 467 | let key: &BStr = pathspec.into(); |
| 510 | 468 | let base = BASELINE |
| 511 | 469 | .get(key) |
| 512 | − .unwrap_or_else(|| panic!("missing baseline for pathspec: {:?}", pathspec)); | |
| 470 | + .unwrap_or_else(|| panic!("missing baseline for pathspec: {pathspec:?}")); | |
| 513 | 471 | *base == 0 |
| 514 | 472 | } |
| 515 | 473 | } |