You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let output = "QEMU emulator version 8.2.2 (Debian 2:8.2.2+ds-0ubuntu1.4+tdx1.0)\nCopyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers";
453
+
let version = parse_qemu_version_from_output(output).unwrap();
454
+
assert_eq!(version,"8.2.2");
455
+
}
456
+
457
+
#[test]
458
+
fntest_parse_qemu_version_simple_format(){
459
+
let output = "QEMU emulator version 9.1.0\nCopyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers";
460
+
let version = parse_qemu_version_from_output(output).unwrap();
461
+
assert_eq!(version,"9.1.0");
462
+
}
463
+
464
+
#[test]
465
+
fntest_parse_qemu_version_old_debian_format(){
466
+
let output = "QEMU emulator version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.2)\nCopyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers";
467
+
let version = parse_qemu_version_from_output(output).unwrap();
468
+
assert_eq!(version,"8.2.2");
469
+
}
470
+
471
+
#[test]
472
+
fntest_parse_qemu_version_with_rc(){
473
+
let output = "QEMU emulator version 9.0.0-rc1\nCopyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers";
474
+
let version = parse_qemu_version_from_output(output).unwrap();
475
+
assert_eq!(version,"9.0.0-rc1");
476
+
}
477
+
478
+
#[test]
479
+
fntest_parse_qemu_version_fallback(){
480
+
let output = "Some unusual format 8.1.5 with version info";
481
+
let version = parse_qemu_version_from_output(output).unwrap();
482
+
assert_eq!(version,"8.1.5");
483
+
}
484
+
485
+
#[test]
486
+
fntest_parse_qemu_version_invalid(){
487
+
let output = "No version information here";
488
+
let result = parse_qemu_version_from_output(output);
0 commit comments