<commit_before>package com.github.gimmi;

import org.junit.Test;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

import static org.assertj.core.api.Assertions.assertThat;

public class AnyTest {
	@Test
	public void should_handle_string_scalar() {
		assertThat(Any.of("hello world").toString()).isEqualTo("hello world");
		assertThat(Any.of((String) null).toString()).isEqualTo("");
		assertThat(Any.of("  ").toString()).isEqualTo("");
		assertThat(Any.of(" x ").toString()).isEqualTo("x");
		assertThat(Any.of("\n\trow1\n\trow2\n").toString()).isEqualTo("row1\n\trow2");
	}

	@Test
	public void should_handle_bigdecimal_scalar() {
		assertThat(Any.of(BigDecimal.valueOf(0)).val(BigDecimal.ZERO)).isEqualTo(BigDecimal.valueOf(0));
		Any any1 = Any.map(x -> x.put("key", Any.of("3.14")));
		assertThat(any1.val(BigDecimal.ZERO)).isEqualTo(BigDecimal.ZERO);
		Any any = Any.list(x -> x.put(Any.of("3.14")));
		assertThat(any.val(BigDecimal.ZERO)).isEqualTo(new BigDecimal("3.14"));
		assertThat(Any.of(BigDecimal.valueOf(314, 2)).val(BigDecimal.ZERO)).isEqualTo(BigDecimal.valueOf(314, 2));
		assertThat(Any.of((BigDecimal) null).val(BigDecimal.ZERO)).isEqualTo(BigDecimal.ZERO);
		assertThat(Any.of("   ").val(BigDecimal.ZERO)).isEqualTo(BigDecimal.ZERO);
	}

	@Test
	public void should_handle_integer_scalar() {
		assertThat(Any.of(0).val(-1)).isZero();
		Any map = Any.map(x -> x.put("key", Any.of("314")));
		assertThat(map.val(-1)).isEqualTo(-1);
		Any list = Any.list(x -> x.put(Any.of("314")));
		assertThat(list.val(0)).isEqualTo(314);
		assertThat(Any.of((Integer) null).val(-1)).isEqualTo(-1);
		assertThat(Any.of("   ").val(-1)).isEqualTo(-1);
		assertThat(Any.of(-314).val(0)).isEqualTo(-314);
	}

	@Test<commit_msg>Replaced toString with val("")<commit_after>package com.github.gimmi;

import org.junit.Test;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

import static org.assertj.core.api.Assertions.assertThat;

public class AnyTest {
	@Test
	public void should_handle_string_scalar() {
		assertThat(Any.of("hello world").val("")).isEqualTo("hello world");
		assertThat(Any.of((String) null).val("")).isEqualTo("");
		assertThat(Any.of("  ").val("")).isEqualTo("");
		assertThat(Any.of(" x ").val("")).isEqualTo("x");
		assertThat(Any.of("\n\trow1\n\trow2\n").val("")).isEqualTo("row1\n\trow2");
	}

	@Test
	public void should_handle_bigdecimal_scalar() {
		assertThat(Any.of(BigDecimal.valueOf(0)).val(BigDecimal.ZERO)).isEqualTo(BigDecimal.valueOf(0));
		Any any1 = Any.map(x -> x.put("key", Any.of("3.14")));
		assertThat(any1.val(BigDecimal.ZERO)).isEqualTo(BigDecimal.ZERO);
		Any any = Any.list(x -> x.put(Any.of("3.14")));
		assertThat(any.val(BigDecimal.ZERO)).isEqualTo(new BigDecimal("3.14"));
		assertThat(Any.of(BigDecimal.valueOf(314, 2)).val(BigDecimal.ZERO)).isEqualTo(BigDecimal.valueOf(314, 2));
		assertThat(Any.of((BigDecimal) null).val(BigDecimal.ZERO)).isEqualTo(BigDecimal.ZERO);
		assertThat(Any.of("   ").val(BigDecimal.ZERO)).isEqualTo(BigDecimal.ZERO);
	}

	@Test
	public void should_handle_integer_scalar() {
		assertThat(Any.of(0).val(-1)).isZero();
		Any map = Any.map(x -> x.put("key", Any.of("314")));
		assertThat(map.val(-1)).isEqualTo(-1);
		Any list = Any.list(x -> x.put(Any.of("314")));
		assertThat(list.val(0)).isEqualTo(314);
		assertThat(Any.of((Integer) null).val(-1)).isEqualTo(-1);
		assertThat(Any.of("   ").val(-1)).isEqualTo(-1);
		assertThat(Any.of(-314).val(0)).isEqualTo(-314);
	}

	@Test
{'fraction_non_alphanumeric': 0.21313299944351696, 'fraction_numerical': 0.027824151363383415, 'mean_word_length': 5.632841328413284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '7048793', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1365, 'n_words': 160}