Less memory allocations at runtime
This commit is contained in:
@@ -128,7 +128,7 @@ fn forget_removes_word() {
|
||||
let stack = f.stack();
|
||||
assert_eq!(stack.len(), 1);
|
||||
match &stack[0] {
|
||||
Value::Str(s, _) => assert_eq!(s, "double"),
|
||||
Value::Str(s, _) => assert_eq!(s.as_ref(), "double"),
|
||||
other => panic!("expected Str, got {:?}", other),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ fn float_literal() {
|
||||
fn string_with_spaces() {
|
||||
let f = run(r#""hello world" !x @x"#);
|
||||
match stack_top(&f) {
|
||||
cagire::forth::Value::Str(s, _) => assert_eq!(s, "hello world"),
|
||||
cagire::forth::Value::Str(s, _) => assert_eq!(s.as_ref(), "hello world"),
|
||||
other => panic!("expected string, got {:?}", other),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ pub fn expect_int(script: &str, expected: i64) {
|
||||
}
|
||||
|
||||
pub fn expect_str(script: &str, expected: &str) {
|
||||
expect_stack(script, &[Value::Str(expected.to_string(), None)]);
|
||||
expect_stack(script, &[Value::Str(Arc::from(expected), None)]);
|
||||
}
|
||||
|
||||
pub fn expect_float(script: &str, expected: f64) {
|
||||
|
||||
Reference in New Issue
Block a user