Migrate benches
This commit is contained in:
@@ -4,9 +4,6 @@
|
||||
|
||||
#[macro_use]
|
||||
extern crate static_assertions;
|
||||
#[cfg(test)]
|
||||
#[macro_use]
|
||||
extern crate maplit;
|
||||
|
||||
#[macro_use]
|
||||
pub(crate) mod macros;
|
||||
@@ -50,6 +47,7 @@ pub use machine::config::*;
|
||||
pub use machine::lib_machine::*;
|
||||
pub use machine::Machine;
|
||||
|
||||
/// Eval a source file in Wasm.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[wasm_bindgen]
|
||||
pub fn eval_code(s: &str) -> String {
|
||||
@@ -57,7 +55,7 @@ pub fn eval_code(s: &str) -> String {
|
||||
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
let mut wam = Machine::with_test_streams();
|
||||
let mut wam = MachineBuilder::default().build();
|
||||
let bytes = wam.test_load_string(s);
|
||||
String::from_utf8_lossy(&bytes).to_string()
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ fn complicated_term() {
|
||||
Term::String("asdf".into()), // String
|
||||
Term::List(vec![
|
||||
Term::Integer(42.into()), // Fixnum
|
||||
Term::Float(2.54.into()), // Float
|
||||
Term::Float(2.54), // Float
|
||||
Term::Atom("asdf".into()), // Atom
|
||||
Term::Atom("a".into()), // Char
|
||||
Term::Compound(
|
||||
@@ -542,7 +542,10 @@ fn differentiate_anonymous_variables() {
|
||||
fn order_of_variables_in_binding() {
|
||||
let mut machine = MachineBuilder::default().build();
|
||||
|
||||
let complete_answer: Vec<_> = machine.run_query("X = Y, Z = W.").collect::<Result<_,_>>().unwrap();
|
||||
let complete_answer: Vec<_> = machine
|
||||
.run_query("X = Y, Z = W.")
|
||||
.collect::<Result<_, _>>()
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
complete_answer,
|
||||
|
||||
Reference in New Issue
Block a user