<commit_before>package infinispan

import (
	"bytes"
	"testing"
)

const conf = `
		{
		 "servers":[
			 {"host": "127.0.0.1", "port": 11222}
		 ],
		 "cacheName": ""
		}
	`

func TestSimplePutAndGet(t *testing.T) {

	if c, err := NewClientJSON(conf); err == nil {
		defer c.Close()

		if _, errPut := c.Put([]byte("1"), []byte("foo")); errPut != nil {
			t.Error(errPut.Error())
		}

		if _, errPut := c.Put([]byte("2"), []byte("bar")); errPut != nil {
			t.Error(errPut.Error())
		}

		if _, errPut := c.Put([]byte("3"), []byte("ugol")); errPut != nil {
			t.Error(errPut.Error())
		}

		if ugol, errGet := c.Get([]byte("3")); errGet == nil {
			if !bytes.Equal([]byte("ugol"), ugol.object) {
				t.Errorf("Expected %v, was %v", []byte("ugol"), ugol)
			}
		} else {
			t.Error(errGet.Error())
		}
	} else {
		t.Error(err.Error())
		return
	}

}<commit_msg>Added GET not found test<commit_after>package infinispan

import (
	"bytes"
	"testing"
)

const conf = `
		{
		 "servers":[
			 {"host": "127.0.0.1", "port": 11222}
		 ],
		 "cacheName": ""
		}
	`

func TestSimplePutAndGet(t *testing.T) {

	if c, err := NewClientJSON(conf); err == nil {
		defer c.Close()

		if _, errPut := c.Put([]byte("1"), []byte("foo")); errPut != nil {
			t.Error(errPut.Error())
		}

		if _, errPut := c.Put([]byte("2"), []byte("bar")); errPut != nil {
			t.Error(errPut.Error())
		}

		if _, errPut := c.Put([]byte("3"), []byte("ugol")); errPut != nil {
			t.Error(errPut.Error())
		}

		if ugol, errGet := c.Get([]byte("3")); errGet == nil {
			if !bytes.Equal([]byte("ugol"), ugol.object) {
				t.Errorf("Expected %v, was %v", []byte("ugol"), ugol)
			}
		} else {
			t.Error(errGet.Error())
		}

		if notFound, errGet := c.Get([]byte("4")); errGet == nil {
			if !bytes.Equal([]byte(""), notFound.object) {
				t.Errorf("Expected %v, was %v", []byte(""), notFound)
			}
		} else {
			t.Error(errGet.Error())
		}

	} else {
		t.Error(err.Error())
		return
	}

}
{'fraction_non_alphanumeric': 0.24499229583975346, 'fraction_numerical': 0.015921931176168466, 'mean_word_length': 3.189247311827957, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6619645', 'n_tokens_mistral': 893, 'n_tokens_neox': 771, 'n_words': 151}