Skip to content

Commit

Permalink
release: v0.0.50
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchantey committed Jul 5, 2024
1 parent 6ea83e9 commit 75b76ee
Show file tree
Hide file tree
Showing 17 changed files with 916 additions and 714 deletions.
1,455 changes: 834 additions & 621 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ members = [
]

[workspace.package]
version = "0.1.49"
version = "0.1.50"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand All @@ -34,26 +34,26 @@ repository = "https://github.com/mrchantey/forky"

[workspace.dependencies]
### internal ###
forky = { path = "./crates/forky/forky", version = "0.1.49" }
forky = { path = "./crates/forky/forky", version = "0.1.50" }
# forky_ai = { path = "./crates/forky/forky_ai", version = "0.1.43" }
forky_bevy = { path = "./crates/forky/forky_bevy", version = "0.1.49" }
forky_cli = { path = "./crates/forky/forky_cli", version = "0.1.49" }
forky_core = { path = "./crates/forky/forky_core", version = "0.1.49" }
forky_fs = { path = "./crates/forky/forky_fs", version = "0.1.49" }
forky_esp = { path = "./crates/forky/forky_esp", version = "0.1.49" }
forky_play = { path = "./crates/forky/forky_play", version = "0.1.49" }
forky_web = { path = "./crates/forky/forky_web", version = "0.1.49" }
forky_web_macros = { path = "./crates/forky/forky_web/macros", version = "0.1.49" }
sweet = { path = "./crates/sweet", version = "0.1.49" }
sweet_macros = { path = "./crates/sweet/macros", version = "0.1.49" }
forky_bevy = { path = "./crates/forky/forky_bevy", version = "0.1.50" }
forky_cli = { path = "./crates/forky/forky_cli", version = "0.1.50" }
forky_core = { path = "./crates/forky/forky_core", version = "0.1.50" }
forky_fs = { path = "./crates/forky/forky_fs", version = "0.1.50" }
forky_esp = { path = "./crates/forky/forky_esp", version = "0.1.50" }
forky_play = { path = "./crates/forky/forky_play", version = "0.1.50" }
forky_web = { path = "./crates/forky/forky_web", version = "0.1.50" }
forky_web_macros = { path = "./crates/forky/forky_web/macros", version = "0.1.50" }
sweet = { path = "./crates/sweet", version = "0.1.50" }
sweet_macros = { path = "./crates/sweet/macros", version = "0.1.50" }

### game ###
# two requirements for back to release:
# 1. recursive type registration https://github.com/bevyengine/bevy/tree/d3e44325b45daf13087a6fe7a425b1744b5f2379
# 2. remove_by_id https://github.com/bevyengine/bevy/pull/9663
# bevy = { path = "../bevy", default-features = false }
# bevy = { git = "https://github.com/bevyengine/bevy.git", rev = "f516de456be2b65572de1af6956d52157663b9cc", default-features = false }
bevy = "=0.14.0-rc.2"
bevy = "0.14"

bevy-inspector-egui = "0.23.4"
bevy_mod_debugdump = "0.10.0"
Expand Down
1 change: 0 additions & 1 deletion crates/forky/forky_ai/test/sweet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
pub use sweet::*;
#[path = "./mod.rs"]
mod tests;
1 change: 0 additions & 1 deletion crates/forky/forky_bevy/test/sweet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
#![allow(
dead_code,
unused_mut,
Expand Down
1 change: 0 additions & 1 deletion crates/forky/forky_cli/test/sweet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
pub use sweet::*;
#[path = "./mod.rs"]
mod tests;
1 change: 0 additions & 1 deletion crates/forky/forky_core/test/sweet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
#[path = "./mod.rs"]
mod tests;
pub use sweet::*;
1 change: 0 additions & 1 deletion crates/forky/forky_fs/test/sweet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
pub use sweet::*;
#[path = "./mod.rs"]
mod tests;
1 change: 0 additions & 1 deletion crates/forky/forky_play/test/sweet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
#![allow(
dead_code,
unused_mut,
Expand Down
1 change: 0 additions & 1 deletion crates/forky/forky_web/test/sweet_wasm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
#![cfg(target_arch = "wasm32")]
pub use sweet::*;
// #[cfg(target_arch = "wasm32")]
Expand Down
1 change: 0 additions & 1 deletion crates/sweet/examples/macro.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
pub use sweet::*;

async fn foo() {}
Expand Down
1 change: 0 additions & 1 deletion crates/sweet/examples/macro_attribute.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(imported_main)]
pub use sweet::*;

#[sweet_test]
Expand Down
1 change: 0 additions & 1 deletion crates/sweet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//! ```rust
//! // examples/sweet.rs
//!
//! #![feature(imported_main)]
//! use sweet::{sweet_test, expect, Result};
//!
//! #[sweet_test]
Expand Down
124 changes: 62 additions & 62 deletions crates/sweet/test/native_tests/backtrace_test.rs
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
use anyhow::Error;
use anyhow::Result;
use sweet::test_case::*;
use sweet::*;


/*
Backtrace depth testing is hard. There are normaly three function layers of abstraction:
1. declarative ie to_be
2. assertion ie assert_equal
3. error ie to_error
*/

fn declarative_level(err: Error) -> Result<()> {
expect(err.to_string().as_str()).to_contain("backtrace_test.rs")
}

fn assertion_level(err: Error) -> Result<()> {
expect(err.to_string().as_str()).not().to_contain(".rs")
}

fn error_level(err: Error) -> Result<()> {
expect(err.to_string().as_str()).not().to_contain(".rs")
// expect(err.to_string().as_str()).to_contain("local_pool.rs")
// expect(err.to_string().as_str()).to_contain("catch_unwind.rs")
}

sweet! {

test "file context" {
let ctx = file_context();
expect(ctx.as_str()).to_contain("let ctx = backtracer::file_context();")?;
// expect(false).to_be_true()?;
}

test "level 1: declarative"{
let result = expect(true).to_be(false);
declarative_level(result.unwrap_err())?;
}

test "level 2: assertion"{
let result = expect(true).assert_equal(false);
assertion_level(result.unwrap_err())?;
let result = expect(true).assert_correct(false,&false);
assertion_level(result.unwrap_err())?;
let result = expect(true).assert_correct_with_received(false,&false,&true);
assertion_level(result.unwrap_err())?;
}

test "level 3: error"{
let err = expect(true).to_error(&false);
error_level(err)?;
let err = expect(true).to_error_with_received(&false,&true);
error_level(err)?;
let err = expect(true).to_error_with_backtrace(&false,0);
error_level(err)?;

// dont think this one is effective
// let err = expect(true).to_error_with_received_and_backtrace(&false,&true,0);
// assertion_level(err)?;
}
}
// use anyhow::Error;
// use anyhow::Result;
// use sweet::test_case::*;
// use sweet::*;


// /*
// Backtrace depth testing is hard. There are normaly three function layers of abstraction:
// 1. declarative ie to_be
// 2. assertion ie assert_equal
// 3. error ie to_error
// */

// fn declarative_level(err: Error) -> Result<()> {
// expect(err.to_string().as_str()).to_contain("backtrace_test.rs")
// }

// fn assertion_level(err: Error) -> Result<()> {
// expect(err.to_string().as_str()).not().to_contain(".rs")
// }

// fn error_level(err: Error) -> Result<()> {
// expect(err.to_string().as_str()).not().to_contain(".rs")
// // expect(err.to_string().as_str()).to_contain("local_pool.rs")
// // expect(err.to_string().as_str()).to_contain("catch_unwind.rs")
// }

// sweet! {

// test "file context" {
// let ctx = file_context();
// expect(ctx.as_str()).to_contain("let ctx = backtracer::file_context();")?;
// // expect(false).to_be_true()?;
// }

// test "level 1: declarative"{
// let result = expect(true).to_be(false);
// declarative_level(result.unwrap_err())?;
// }

// test "level 2: assertion"{
// let result = expect(true).assert_equal(false);
// assertion_level(result.unwrap_err())?;
// let result = expect(true).assert_correct(false,&false);
// assertion_level(result.unwrap_err())?;
// let result = expect(true).assert_correct_with_received(false,&false,&true);
// assertion_level(result.unwrap_err())?;
// }

// test "level 3: error"{
// let err = expect(true).to_error(&false);
// error_level(err)?;
// let err = expect(true).to_error_with_received(&false,&true);
// error_level(err)?;
// let err = expect(true).to_error_with_backtrace(&false,0);
// error_level(err)?;

// // dont think this one is effective
// // let err = expect(true).to_error_with_received_and_backtrace(&false,&true,0);
// // assertion_level(err)?;
// }
// }
2 changes: 1 addition & 1 deletion crates/sweet/test/sweet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(imported_main, async_closure)]
#![feature(async_closure)]
pub use sweet::main;
mod common;
// #[cfg(not(target_arch = "wasm32"))]
Expand Down
2 changes: 1 addition & 1 deletion crates/sweet/test/sweet_wasm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(imported_main, async_closure)]
#![feature(async_closure)]
pub use sweet::*;
#[cfg(feature = "bevy")]
mod bevy_tests;
Expand Down
1 change: 0 additions & 1 deletion docs/src/sweet/native/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
```
1. create file `test/sweet.rs`
```rs
#![feature(imported_main)]
pub use sweet::*;

#[sweet_test]
Expand Down
10 changes: 5 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ publish-all:
just publish forky_fs | true
just publish forky_web_macros | true
just publish forky_web | true
just publish forky_cli | true
just publish sweet_macros | true
just publish sweet | true
just publish sweet-cli | true
just publish forky_cli | true
just publish forky_bevy | true
just publish forky_play | true

Expand All @@ -117,10 +117,10 @@ ci:
# cargo run -p forky_play --example test_forky_play --features sweet/bevy -- --parallel
test-all *args:
cargo run -p sweet --example test_sweet --features sweet/bevy -- --parallel
cargo run -p forky_bevy --example test_forky_bevy -- --parallel
cargo run -p forky_cli --example test_forky_cli -- --parallel
cargo run -p forky_fs_test --example test_forky_fs_test -- --parallel
cargo run -p forky_core_test --example test_forky_core_test -- --parallel
cargo run -p forky_bevy --example test_forky_bevy -- --parallel
cargo run -p forky_cli --example test_forky_cli -- --parallel
cargo run -p forky_fs_test --example test_forky_fs_test -- --parallel
cargo run -p forky_core_test --example test_forky_core_test -- --parallel

test crate *args:
RUST_BACKTRACE={{backtrace}} cargo run -p {{crate}} --example test_{{crate}} {{features}} -- {{args}}
Expand Down

0 comments on commit 75b76ee

Please sign in to comment.