Skip to content

Commit

Permalink
fixed github-ci tests
Browse files Browse the repository at this point in the history
...

...

...

...

...

....ugh

...
  • Loading branch information
sokorototo committed Feb 10, 2025
1 parent 43b42bc commit 502bdc5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ workspace.code-workspace
.cargo/config.toml

# Test Archives
/crates/vach/test_data/**/target.vach
/crates/vach/test_data/*

# Cargo
.cargo
30 changes: 16 additions & 14 deletions crates/vach/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use crate::prelude::*;
const KEYPAIR: &[u8; crate::SECRET_KEY_LENGTH + crate::PUBLIC_KEY_LENGTH] = include_bytes!("../test_data/pair.pub");

// The paths to the Archives, to be written|loaded
const SIGNED_TARGET: &str = "test_data/signed/target.vach";
const SIMPLE_TARGET: &str = "test_data/simple/target.vach";
const ENCRYPTED_TARGET: &str = "test_data/encrypted/target.vach";
const SIGNED_TARGET: &str = "test_data/signed.vach";
const SIMPLE_TARGET: &str = "test_data/simple.vach";
const ENCRYPTED_TARGET: &str = "test_data/encrypted.vach";

// Custom bitflag tests
const CUSTOM_FLAG_1: u32 = 0b0000_0000_0000_0000_0000_1000_0000_0000;
Expand Down Expand Up @@ -105,28 +105,30 @@ fn flags_set_intersects() {

#[test]
#[cfg(all(feature = "compression", feature = "builder"))]
fn builder_no_signature() -> InternalResult {
fn builder_no_signature() {
use std::fs::OpenOptions;

let build_config = BuilderConfig::default();

let mut poem_flags = Flags::default();
poem_flags.set(CUSTOM_FLAG_1 | CUSTOM_FLAG_2 | CUSTOM_FLAG_3 | CUSTOM_FLAG_4, true)?;
poem_flags
.set(CUSTOM_FLAG_1 | CUSTOM_FLAG_2 | CUSTOM_FLAG_3 | CUSTOM_FLAG_4, true)
.unwrap();

let mut leaves = [
Leaf::new(File::open("test_data/song.txt")?, "song"),
Leaf::new(File::open("test_data/lorem.txt")?, "lorem"),
Leaf::new(File::open("test_data/bee.script")?, "script"),
Leaf::new(File::open("test_data/quicksort.wasm")?, "wasm"),
Leaf::new(File::open("test_data/poem.txt")?, "poem")
Leaf::new(File::open("test_data/song.txt").unwrap(), "song"),
Leaf::new(File::open("test_data/lorem.txt").unwrap(), "lorem"),
Leaf::new(File::open("test_data/bee.script").unwrap(), "script"),
Leaf::new(File::open("test_data/quicksort.wasm").unwrap(), "wasm"),
Leaf::new(File::open("test_data/poem.txt").unwrap(), "poem")
.compress(CompressMode::Always)
.version(10)
.flags(poem_flags),
Leaf::new(b"Hello, Cassandra!" as &[u8], "greeting").compress(CompressMode::Never),
];

let mut target = File::create(SIMPLE_TARGET)?;
dump(&mut target, &mut leaves, &build_config, None)?;

Ok(())
let mut target = OpenOptions::new().write(true).create(true).read(true).open(SIMPLE_TARGET).unwrap();
dump(&mut target, &mut leaves, &build_config, None).unwrap();
}

#[test]
Expand Down

0 comments on commit 502bdc5

Please sign in to comment.