Skip to content

Commit

Permalink
Revert changed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
stargazing-dino committed May 17, 2024
1 parent 22f524f commit 09457ed
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions crates/yarnspinner/tests/type_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,25 +402,27 @@ fn test_initial_values() -> anyhow::Result<()> {
// so this would be "True" instead.
.expect_line("true")
// external decls
.expect_line("0")
.expect_line("Bye")
.expect_line("42")
.expect_line("Hello")
// ## Implementation note: See above
.expect_line("false"),
.expect_line("true"),
);

let result = Compiler::from_test_source(source)
.extend_library(test_base.dialogue.library().clone())
.declare_variable(Declaration::new("$external_str", Type::String).with_default_value("Bye"))
.declare_variable(Declaration::new("$external_int", Type::Number).with_default_value(0))
.declare_variable(
Declaration::new("$external_bool", Type::Boolean).with_default_value(false),
Declaration::new("$external_str", Type::String).with_default_value("Hello"),
)
.declare_variable(Declaration::new("$external_int", Type::Number).with_default_value(42))
.declare_variable(
Declaration::new("$external_bool", Type::Boolean).with_default_value(true),
)
.compile()?;

let mut variable_storage = test_base.variable_storage.clone_shallow();
variable_storage.set("$external_str".to_string(), "Bye".into())?;
variable_storage.set("$external_int".to_string(), 0.into())?;
variable_storage.set("$external_bool".to_string(), false.into())?;
variable_storage.set("$external_str".to_string(), "Hello".into())?;
variable_storage.set("$external_int".to_string(), 42.into())?;
variable_storage.set("$external_bool".to_string(), true.into())?;

test_base.with_compilation(result).run_standard_testcase();
Ok(())
Expand Down

0 comments on commit 09457ed

Please sign in to comment.