Merge pull request 'test fixes' (#5) from smaller-fixes-for-tests into main

Reviewed-on: #5
This commit is contained in:
Robin Müller 2024-11-08 17:14:22 +01:00
commit fae27bdf93
2 changed files with 6 additions and 6 deletions

View File

@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.75.0 - uses: dtolnay/rust-toolchain@1.81.0
- run: cargo check --release - run: cargo check --release
cross-check: cross-check:

View File

@ -4,8 +4,7 @@ use spacepackets::ByteConversionError;
pub use std_mod::*; pub use std_mod::*;
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(all(feature = "defmt", not(feature = "std")), derive(defmt::Format))]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[non_exhaustive] #[non_exhaustive]
pub enum FilestoreError { pub enum FilestoreError {
#[error("file does not exist")] #[error("file does not exist")]
@ -121,7 +120,8 @@ pub mod std_mod {
use super::*; use super::*;
use std::{ use std::{
fs::{self, File, OpenOptions}, fs::{self, File, OpenOptions},
io::{BufReader, Read, Seek, SeekFrom, Write}, path::Path, io::{BufReader, Read, Seek, SeekFrom, Write},
path::Path,
}; };
#[derive(Default)] #[derive(Default)]
@ -642,7 +642,7 @@ mod tests {
} }
assert_eq!( assert_eq!(
error.to_string(), error.to_string(),
format!("filestore error: {}", byte_conv_error) format!("byte conversion: {}", byte_conv_error)
); );
} else { } else {
panic!("unexpected error"); panic!("unexpected error");
@ -765,7 +765,7 @@ mod tests {
if let FilestoreError::ChecksumTypeNotImplemented(cksum_type) = error { if let FilestoreError::ChecksumTypeNotImplemented(cksum_type) = error {
assert_eq!( assert_eq!(
error.to_string(), error.to_string(),
format!("checksum {:?} not implemented", cksum_type) format!("checksum type not implemented: {:?}", cksum_type)
); );
} else { } else {
panic!("unexpected error"); panic!("unexpected error");