From 3e6cb639f0d9afde57d9cc03526c2e488641231b Mon Sep 17 00:00:00 2001 From: Costin-Robert Sin Date: Tue, 21 Jun 2022 15:36:05 +0300 Subject: Fix all formating problems to pass CI formating test Signed-off-by: Costin-Robert Sin --- test/test_nmount.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'test/test_nmount.rs') diff --git a/test/test_nmount.rs b/test/test_nmount.rs index 4c74ecf6..dec806a5 100644 --- a/test/test_nmount.rs +++ b/test/test_nmount.rs @@ -1,13 +1,9 @@ use crate::*; use nix::{ errno::Errno, - mount::{MntFlags, Nmount, unmount} -}; -use std::{ - ffi::CString, - fs::File, - path::Path + mount::{unmount, MntFlags, Nmount}, }; +use std::{ffi::CString, fs::File, path::Path}; use tempfile::tempdir; #[test] @@ -24,14 +20,15 @@ fn ok() { .str_opt(&fstype, &nullfs) .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) .str_opt_owned("target", target.path().to_str().unwrap()) - .nmount(MntFlags::empty()).unwrap(); - + .nmount(MntFlags::empty()) + .unwrap(); + // Now check that the sentry is visible through the mountpoint let exists = Path::exists(&mountpoint.path().join("sentry")); // Cleanup the mountpoint before asserting unmount(mountpoint.path(), MntFlags::empty()).unwrap(); - + assert!(exists); } @@ -44,8 +41,9 @@ fn bad_fstype() { let e = Nmount::new() .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) .str_opt_owned("target", target.path().to_str().unwrap()) - .nmount(MntFlags::empty()).unwrap_err(); - + .nmount(MntFlags::empty()) + .unwrap_err(); + assert_eq!(e.error(), Errno::EINVAL); assert_eq!(e.errmsg(), Some("Invalid fstype")); } -- cgit v1.2.3