<commit_before>#![cfg(test)]
use std::cell::RefCell;
use std::rc::Rc;

use alloc_box::AllocBox;
use ast::{Exp, Stmt};
use types::js_fn::JsFnStruct;
use types::js_obj::JsObjStruct;
use types::js_str::JsStrStruct;
use types::js_var::{JsKey, JsPtrEnum, JsPtrTag, JsType, JsVar};

pub fn make_str(s: &str) -> (JsVar, JsPtrEnum) {
    let var = JsVar::new(JsType::JsPtr(JsPtrTag::JsStr));
    (var, JsPtrEnum::JsStr(JsStrStruct::new(s)))
}

pub fn make_num(i: f64) -> JsVar {
    JsVar::new(JsType::JsNum(i))
}

pub fn make_obj(kvs: Vec<(JsKey, JsVar, Option<JsPtrEnum>)>, heap: Rc<RefCell<AllocBox>>) -> (JsVar, JsPtrEnum) {
    let var = JsVar::new(JsType::JsPtr(JsPtrTag::JsObj));
    (var, JsPtrEnum::JsObj(JsObjStruct::new(None, "test", kvs, &mut *heap.borrow_mut())))
}

pub fn make_fn(name: &Option<String>, params: &Vec<String>) -> (JsVar, JsPtrEnum) {
    let var = JsVar::new(JsType::JsPtr(JsPtrTag::JsFn { name: None }));
    (var, JsPtrEnum::JsFn(JsFnStruct::new(name, params, &vec![Stmt::BareExp(Exp::Undefined)])))
}

pub fn make_alloc_box() -> Rc<RefCell<AllocBox>> {
    Rc::new(RefCell::new(AllocBox::new()))
}
<commit_msg>get rid of test configuration because it apparently breaks things<commit_after>use std::cell::RefCell;
use std::rc::Rc;

use alloc_box::AllocBox;
use ast::{Exp, Stmt};
use types::js_fn::JsFnStruct;
use types::js_obj::JsObjStruct;
use types::js_str::JsStrStruct;
use types::js_var::{JsKey, JsPtrEnum, JsPtrTag, JsType, JsVar};

pub fn make_str(s: &str) -> (JsVar, JsPtrEnum) {
    let var = JsVar::new(JsType::JsPtr(JsPtrTag::JsStr));
    (var, JsPtrEnum::JsStr(JsStrStruct::new(s)))
}

pub fn make_num(i: f64) -> JsVar {
    JsVar::new(JsType::JsNum(i))
}

pub fn make_obj(kvs: Vec<(JsKey, JsVar, Option<JsPtrEnum>)>, heap: Rc<RefCell<AllocBox>>) -> (JsVar, JsPtrEnum) {
    let var = JsVar::new(JsType::JsPtr(JsPtrTag::JsObj));
    (var, JsPtrEnum::JsObj(JsObjStruct::new(None, "test", kvs, &mut *heap.borrow_mut())))
}

pub fn make_fn(name: &Option<String>, params: &Vec<String>) -> (JsVar, JsPtrEnum) {
    let var = JsVar::new(JsType::JsPtr(JsPtrTag::JsFn { name: None }));
    (var, JsPtrEnum::JsFn(JsFnStruct::new(name, params, &vec![Stmt::BareExp(Exp::Undefined)])))
}

pub fn make_alloc_box() -> Rc<RefCell<AllocBox>> {
    Rc::new(RefCell::new(AllocBox::new()))
}

{'fraction_non_alphanumeric': 0.20363951473136915, 'fraction_numerical': 0.0017331022530329288, 'mean_word_length': 6.774410774410774, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1730232', 'n_tokens_mistral': 965, 'n_tokens_neox': 968, 'n_words': 168}