Skip to content

Commit

Permalink
tests(handlers): assert custom commands defined in a handler config s…
Browse files Browse the repository at this point in the history
…cript can modify the environment
  • Loading branch information
cablehead committed Jan 11, 2025
1 parent 5e5b54f commit e867ac8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cross-stream"
edition = "2021"
version = "0.2.0"
version = "0.2.2-dev"
description = "An event stream store for personal, local-first use, specializing in event sourcing."
license = "MIT"
repository = "https://github.com/cablehead/xs"
Expand Down
10 changes: 8 additions & 2 deletions src/handlers/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,11 +603,17 @@ async fn test_handler_preserve_env() -> Result<(), Error> {
.hash(store.cas_insert_sync(
r#"
$env.abc = .head abc.init | .cas $in.hash | from json
def --env inc-abc [] {
$env.abc = $env.abc + 1
$env.abc
}
{
process: {|frame|
if $frame.topic != "trigger" { return }
$env.abc = $env | default 0 abc | get abc | $in + 1
$env.abc
inc-abc
}
}
"#,
Expand Down

0 comments on commit e867ac8

Please sign in to comment.