<commit_before>
package com.esotericsoftware.kryo.serialize;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;

import junit.framework.TestCase;

import org.junit.Assert;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.NotNull;
import com.esotericsoftware.kryo.Serializer;

// TODO - Write tests for all serializers.
// TODO - Break this monolithic test into smaller tests.

public class SerializerTest extends TestCase {
	private ByteBuffer buffer = ByteBuffer.allocateDirect(500);

	private int intValues[] = {
	//
		0, 1, 2, 3, //
		-1, -2, -3, //
		32, -32, //
		127, 128, 129, //
		-125, -126, -127, -128, //
		252, 253, 254, 255, 256, //
		-252, -253, -254, -255, -256, //
		32767, 32768, 32769, //
		-32767, -32768, -32769, //
		65535, 65536, 65537, //
		Integer.MAX_VALUE, Integer.MIN_VALUE, //
	};

	public void testStrings () {
		roundTrip(new StringSerializer(), 21, "abcdef\u1234");
	}

	public void testCollection () {
		Kryo kryo = new Kryo();
		CollectionSerializer serializer = new CollectionSerializer(kryo);
		roundTrip(serializer, 11, new ArrayList(Arrays.asList("1", "2", "3")));
		roundTrip(serializer, 13, new ArrayList(Arrays.asList("1", "2", null, 1, 2)));
		roundTrip(serializer, 15, new ArrayList(Arrays.asList("1", "2", null, 1, 2, 5)));
		roundTrip(serializer, 11, new ArrayList(Arrays.asList("1", "2", "3")));
		roundTrip(serializer, 11, new ArrayList(Arrays.asList("1", "2", "3")));
		serializer.setElementClass(String.class);<commit_msg>Changed funky characters in string test to escaped characters.<commit_after>
package com.esotericsoftware.kryo.serialize;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;

import junit.framework.TestCase;

import org.junit.Assert;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.NotNull;
import com.esotericsoftware.kryo.Serializer;

// TODO - Write tests for all serializers.
// TODO - Break this monolithic test into smaller tests.

public class SerializerTest extends TestCase {
	private ByteBuffer buffer = ByteBuffer.allocateDirect(500);

	private int intValues[] = {
	//
		0, 1, 2, 3, //
		-1, -2, -3, //
		32, -32, //
		127, 128, 129, //
		-125, -126, -127, -128, //
		252, 253, 254, 255, 256, //
		-252, -253, -254, -255, -256, //
		32767, 32768, 32769, //
		-32767, -32768, -32769, //
		65535, 65536, 65537, //
		Integer.MAX_VALUE, Integer.MIN_VALUE, //
	};

	public void testStrings () {
		roundTrip(new StringSerializer(), 21, "abcdef\u00E1\u00E9\u00ED\u00F3\u00FA\u1234");
	}

	public void testCollection () {
		Kryo kryo = new Kryo();
		CollectionSerializer serializer = new CollectionSerializer(kryo);
		roundTrip(serializer, 11, new ArrayList(Arrays.asList("1", "2", "3")));
		roundTrip(serializer, 13, new ArrayList(Arrays.asList("1", "2", null, 1, 2)));
		roundTrip(serializer, 15, new ArrayList(Arrays.asList("1", "2", null, 1, 2, 5)));
		roundTrip(serializer, 11, new ArrayList(Arrays.asList("1", "2", "3")));
		roundTrip(serializer, 11, new ArrayList(Arrays.asList("1", "2", "3")));
		serializer.setElementClass(String.class);
{'fraction_non_alphanumeric': 0.16299969011465756, 'fraction_numerical': 0.09327548806941431, 'mean_word_length': 4.115689381933439, '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': '7148995', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1174, 'n_words': 287}