fn test_fabric_error()

in crates/libs/core/src/error/mod.rs [122:140]


    fn test_fabric_error() {
        let fe = Error::from(FABRIC_E_CODE_PACKAGE_NOT_FOUND);
        // check debug string
        assert_eq!(
            format!("{:?}", fe),
            "FabricError { code: -2147017733, message: FABRIC_E_CODE_PACKAGE_NOT_FOUND }"
        );
        // check display string
        assert_eq!(
            format!("{}", fe),
            "FABRIC_E_CODE_PACKAGE_NOT_FOUND (-2147017733)"
        );
        let e = crate::WinError::from(fe.clone());
        assert_eq!(e.code(), fe.into());
        let ec = Error::from(e)
            .try_as_fabric_error_code()
            .expect("unknown code");
        assert_eq!(ec, ErrorCode::FABRIC_E_CODE_PACKAGE_NOT_FOUND);
    }