<commit_before>// notification_test.go
package engine

import (
	"testing"
	"time"
)

func TestNotifGetString(t *testing.T) {
	var campos = map[string]interface{}{"uno": 1, "cadena": "alfanumerica"}
	var n = Notif{ID: "example_id", Received: time.Now(), Data: campos}

	s, err := n.GetString("$uno")
	if err != nil {
		t.Error(err)
	}
	if s != "1" {
		t.Errorf("%q != \"1\"", s)
	}
	s, err = n.GetString("$cadena")
	if err != nil {
		t.Fatal(err)
	}
	if s != "alfanumerica" {
		t.Fatalf("%q != \"1\"", s)
	}

}

func TestNotifGetNumber(t *testing.T) {
	var campos = map[string]interface{}{"uno": 1, "cadena": "alfanumerica"}
	var n = Notif{ID: "example_id", Received: time.Now(), Data: campos}

	i, err := n.GetNumber("$uno")
	if err != nil {
		t.Fatal(err)
	}
	if i != 1 {
		t.Fatalf("%f != 1", i)
	}
}

func TestNotifGetNestedNumber(t *testing.T) {
	type dic map[string]interface{}
	var campos = map[string]interface{}{
		"uno": map[string]interface{}{
			"otro": map[string]interface{}{
				"mas": 1}},
		"cadena": "alfanumérica"}
	var n = Notif{ID: "example_id", Received: time.Now(), Data: campos}
	i, err := n.GetNumber("$uno.otro.mas")
	if err != nil {
		t.Fatal(err)
	}
	if i != 1 {
		t.Fatalf("%f != 1", i)
	}
}

func TestNotifGetNestedString(t *testing.T) {
	var campos = map[string]interface{}{
		"cadena": map[string]interface{}{
			"otro": map[string]interface{}{
				"mas": "alfanumérica"}},
		"uno": 1.0}
	var n = Notif{ID: "example_id", Received: time.Now(), Data: campos}
	i, err := n.GetString("$cadena.otro.mas")
	if err != nil {
		t.Fatal(err)
	}
	if i != "alfanumérica" {
		t.Fatalf("%s != alfanumérica", i)
	}
}
<commit_msg>Update test for notification<commit_after>// notification_test.go
package engine

import (
	"testing"
	"time"
)

func TestNotifGetString(t *testing.T) {
	var campos = map[string]interface{}{"uno": 1, "cadena": "alfanumerica"}
	var n = Notif{ID: "example_id", Received: time.Now(), Data: campos}

	s, err := n.GetString("uno")
	if err != nil {
		t.Error(err)
	}
	if s != "1" {
		t.Errorf("%q != \"1\"", s)
	}
	s, err = n.GetString("cadena")
	if err != nil {
		t.Fatal(err)
	}
	if s != "alfanumerica" {
		t.Fatalf("%q != \"1\"", s)
	}

}

func TestNotifGetNumber(t *testing.T) {
	var campos = map[string]interface{}{"uno": 1, "cadena": "alfanumerica"}
	var n = Notif{ID: "example_id", Received: time.Now(), Data: campos}

	i, err := n.GetNumber("uno")
	if err != nil {
		t.Fatal(err)
	}
	if i != 1 {
		t.Fatalf("%f != 1", i)
	}
}

func TestNotifGetNestedNumber(t *testing.T) {
	type dic map[string]interface{}
	var campos = map[string]interface{}{
		"uno": map[string]interface{}{
			"otro": map[string]interface{}{
				"mas": 1}},
		"cadena": "alfanumérica"}
	var n = Notif{ID: "example_id", Received: time.Now(), Data: campos}
	i, err := n.GetNumber("uno.otro.mas")
	if err != nil {
		t.Fatal(err)
	}
	if i != 1 {
		t.Fatalf("%f != 1", i)
	}
}

func TestNotifGetNestedString(t *testing.T) {
	var campos = map[string]interface{}{
		"cadena": map[string]interface{}{
			"otro": map[string]interface{}{
				"mas": "alfanumérica"}},
		"uno": 1.0}
	var n = Notif{ID: "example_id", Received: time.Now(), Data: campos}
	i, err := n.GetString("cadena.otro.mas")
	if err != nil {
		t.Fatal(err)
	}
	if i != "alfanumérica" {
		t.Fatalf("%s != alfanumérica", i)
	}
}

{'fraction_non_alphanumeric': 0.2135069654754694, 'fraction_numerical': 0.0072683222289521504, 'mean_word_length': 3.944610778443114, 'pattern_counts': {'":': 24, '<': 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': '6689602', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1404, 'n_words': 309}