<commit_before>// TOML test suite for [1]
//
// [1]: https://github.com/BurntSushi/toml-test
//
// If given a path, it will perform the same tests like toml-test [1],
// so no need to install "go" :).

extern crate extra = "extra#0.10-pre";
extern crate collections = "collections#0.10-pre";
extern crate toml = "github.com/mneumann/rust-toml#toml:0.1";

use extra::json::{Json,String,List,Object};

use collections::treemap::TreeMap;
use std::os;
use std::path::Path;
use std::io::fs::walk_dir;
use std::io::File;

fn to_json_type(typ: ~str, val: Json) -> Json {
    let mut tree = ~TreeMap::new();
    tree.insert(~"type", String(typ));
    tree.insert(~"value", val);
    Object(tree)
}

fn format_float(f: f64) -> ~str {
    let str = format!("{:.15f}", f);
    let str = str.as_slice();<commit_msg>json moved from extra to serialize<commit_after>// TOML test suite for [1]
//
// [1]: https://github.com/BurntSushi/toml-test
//
// If given a path, it will perform the same tests like toml-test [1],
// so no need to install "go" :).

extern crate serialize;
extern crate collections = "collections#0.10-pre";
extern crate toml = "github.com/mneumann/rust-toml#toml:0.1";

use serialize::json::{Json,String,List,Object};

use collections::treemap::TreeMap;
use std::os;
use std::path::Path;
use std::io::fs::walk_dir;
use std::io::File;

fn to_json_type(typ: ~str, val: Json) -> Json {
    let mut tree = ~TreeMap::new();
    tree.insert(~"type", String(typ));
    tree.insert(~"value", val);
    Object(tree)
}

fn format_float(f: f64) -> ~str {
    let str = format!("{:.15f}", f);
    let str = str.as_slice();
{'fraction_non_alphanumeric': 0.19183168316831684, 'fraction_numerical': 0.01670792079207921, 'mean_word_length': 4.117088607594937, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '1267703', 'n_tokens_mistral': 619, 'n_tokens_neox': 605, 'n_words': 157}