test(hostid) add a test for hostid (#1533)

This commit is contained in:
Sylvestre Ledru 2020-06-08 09:09:44 +02:00 committed by GitHub
parent a7de28a714
commit f87b041e27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1 +1,13 @@
// ToDO: add tests
use crate::common::util::*;
extern crate regex;
use self::regex::Regex;
#[test]
fn test_normal() {
let (_, mut ucmd) = at_and_ucmd!();
let result = ucmd.run();
assert!(result.success);
let re = Regex::new(r"^[0-9a-f]{8}").unwrap();
assert!(re.is_match(&result.stdout.trim()));
}