<commit_before>package io.vertx.ext.mail.mailencoder;

import static org.junit.Assert.*;

import org.junit.Test;

public class UtilsTest {

  @Test
  public void testMustEncodeChar() {
    StringBuilder sb=new StringBuilder();

    for(int i=0;i<256;i++) {
      if(!Utils.mustEncode((char)i)) {
        sb.append((char)i);
      }
    }
    assertEquals("\n !\"#$%&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f", sb.toString());
  }

  @Test
  public void testDate() {
    System.out.println(Utils.generateDate());
  }

  @Test
  public void testBase64() {
    assertEquals("", Utils.base64(""));
    assertEquals("Kg==", Utils.base64("*"));
    assertEquals("KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\n" + 
        "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==",
        conv2nl(Utils.base64("**********************************************************************************************")));
  }

  // convert windows style line endings
  private String conv2nl(String string) {
    if(System.lineSeparator().equals("\n")) {
      return string;
    } else {
      return string.replace(System.lineSeparator(), "\n");
    }
  }
  
}<commit_msg>base64 uses CRLF for some reason, changed the converter in unit test<commit_after>package io.vertx.ext.mail.mailencoder;

import static org.junit.Assert.*;

import org.junit.Test;

public class UtilsTest {

  @Test
  public void testMustEncodeChar() {
    StringBuilder sb=new StringBuilder();

    for(int i=0;i<256;i++) {
      if(!Utils.mustEncode((char)i)) {
        sb.append((char)i);
      }
    }
    assertEquals("\n !\"#$%&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f", sb.toString());
  }

  @Test
  public void testDate() {
    System.out.println(Utils.generateDate());
  }

  @Test
  public void testBase64() {
    assertEquals("", Utils.base64(""));
    assertEquals("Kg==", Utils.base64("*"));
    assertEquals("KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\n" + 
        "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==",
        conv2nl(Utils.base64("**********************************************************************************************")));
  }

  // convert windows style line endings
  // TODO: not sure why the java8 base64 classes use CRLF
  private String conv2nl(String string) {
      return string.replace("\r\n", "\n");
  }
  
}
{'fraction_non_alphanumeric': 0.2245881880273202, 'fraction_numerical': 0.023704298915227, 'mean_word_length': 4.242105263157895, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4552901', 'n_tokens_mistral': 969, 'n_tokens_neox': 906, 'n_words': 129}