clutils 0.0.11

A common library for building interpreter and compiler
Documentation
#[cfg(test)]
mod tests {

    use std::{io, path::PathBuf};

    use crate::{
        files::FileHandler,
        map,
        snapshots::SnapshotTest,
    };

    #[test]
    fn filehandler() -> io::Result<()> {
        let path = PathBuf::from("tests/test.txt");
        let fh = FileHandler::new(&path)?;
        assert_eq!(&fh.file_content, "test for filehandler");
        Ok(())
    }

    #[test]
    fn map_macro() {
        let macro_map = map!("first" => 1, "second" => 2, "third" => 3);
        let mut manual_map = map!();
        manual_map.insert("first", 1);
        manual_map.insert("second", 2);
        manual_map.insert("third", 3);
        assert_eq!(macro_map, manual_map)
    }

    #[test]
    fn snapshots() {
        let snapshot = SnapshotTest::new("testing", PathBuf::from("tests/main.c"));
        snapshot.setup_dir();
        snapshot.create_snapshot();
    }
}