<commit_before>package dynmap

import (
	"log"
	"testing"
)

//go test -v github.com/trendrr/goshire/cheshire
func TestJsonMarshal(t *testing.T) {
	mp := NewDynMap()
	mp.PutWithDot("this.that.test", 80)
	mp.PutWithDot("this.eight", 8)
	bytes, _ := mp.MarshalJSON()
	log.Printf("Got JSON %s", bytes)

	un := NewDynMap()
	un.UnmarshalJSON(bytes)

	unbytes, _ := mp.MarshalJSON()
	if string(unbytes) != string(bytes) {
		t.Errorf("JSon marshal failed (%s) != (%s)", unbytes, bytes)
	}
}

func TestURLEncode(t *testing.T) {
	mp := NewDynMap()
	mp.PutWithDot("this.that.test", 80)
	mp.PutWithDot("this.eight", 8)
	url, err := mp.MarshalURL()
	if err != nil {
		t.Errorf("Error in url %s", err)
	}

	log.Printf("Got URL : %s", url)

	un := NewDynMap()
	un.UnmarshalURL(url)

	if un.MustInt("this.that.test", 0) != 80 {
		t.Errorf("Unmarshal URL failure ")
	}
}<commit_msg>switch to dynmap.New calls<commit_after>package dynmap

import (
	"log"
	"testing"
)

//go test -v github.com/trendrr/goshire/cheshire
func TestJsonMarshal(t *testing.T) {
	mp := New()
	mp.PutWithDot("this.that.test", 80)
	mp.PutWithDot("this.eight", 8)
	bytes, _ := mp.MarshalJSON()
	log.Printf("Got JSON %s", bytes)

	un := New()
	un.UnmarshalJSON(bytes)

	unbytes, _ := mp.MarshalJSON()
	if string(unbytes) != string(bytes) {
		t.Errorf("JSon marshal failed (%s) != (%s)", unbytes, bytes)
	}
}

func TestURLEncode(t *testing.T) {
	mp := New()
	mp.PutWithDot("this.that.test", 80)
	mp.PutWithDot("this.eight", 8)
	url, err := mp.MarshalURL()
	if err != nil {
		t.Errorf("Error in url %s", err)
	}

	log.Printf("Got URL : %s", url)

	un := New()
	un.UnmarshalURL(url)

	if un.MustInt("this.that.test", 0) != 80 {
		t.Errorf("Unmarshal URL failure ")
	}
}

{'fraction_non_alphanumeric': 0.1910569105691057, 'fraction_numerical': 0.010452961672473868, 'mean_word_length': 4.038011695906433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5177710', 'n_tokens_mistral': 746, 'n_tokens_neox': 702, 'n_words': 149}