зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1677763 - [mozdevice-rust] Added tests for formatting own DeviceError types. r=webdriver-reviewers,jgraham
Those checks will make sure that we don't enter an infinite loop anymore when trying to format one of our own DeviceError types. Skupin <mail@hskupin.info> HG: branch 'default' HG: bookmark 'geckodriver_overflow' HG: changed testing/mozbase/rust/mozdevice/src/test.rs Differential Revision: https://phabricator.services.mozilla.com/D109057
This commit is contained in:
Родитель
8757457e37
Коммит
b753cecd07
|
@ -506,3 +506,24 @@ fn device_push_dir() {
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format_own_device_error_types() {
|
||||
assert_eq!(
|
||||
format!("{}", DeviceError::InvalidStorage),
|
||||
"Invalid storage".to_string()
|
||||
);
|
||||
assert_eq!(
|
||||
format!("{}", DeviceError::MissingPackage),
|
||||
"Missing package".to_string()
|
||||
);
|
||||
assert_eq!(
|
||||
format!("{}", DeviceError::MultipleDevices),
|
||||
"Multiple Android devices online".to_string()
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
format!("{}", DeviceError::Adb("foo".to_string())),
|
||||
"foo".to_string()
|
||||
);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче