<commit_before>package blanco.apex.formatter;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.junit.Test;

import blanco.apex.parser.BlancoApexParserUtil;
import blanco.apex.parser.token.BlancoApexToken;

public class BlancoApexFormatter003Test {
	private static final String TARGET_FILE1 = "./test/data/apex/MySimpleTest2.cls";

	@Test
	public void test() throws IOException {
		final List<BlancoApexToken> tokenList = new BlancoApexFormatter(new BlancoApexFormatterSettings())
				.format(new File(TARGET_FILE1)); //
		if (false)
			System.out.println(BlancoApexParserUtil.tokenList2String(tokenList));
		if (true)
			System.out.println(tokenList.get(0).getDisplayString());

		assertEquals(
				"SOURCE[ANNOTATION[SPECIAL_CHAR[@],WORD[isTest],NEWLINE[n]],CLASS[WORD[public],WHITESPACE[ ],WORD[without],WHITESPACE[ ],WORD[sharing],WHITESPACE[ ],WORD[class],WHITESPACE[ ],WORD[MySimpleTest],BLOCK(CLASS_DEF)[SPECIAL_CHAR[{],NEWLINE[n],WHITESPACE[    ],METHOD[WORD[static]WHITESPACE[ ]WORD[testMethod]WHITESPACE[ ]WORD[void]WHITESPACE[ ]WORD[testMain002]PARENTHESIS[SPECIAL_CHAR[(],SPECIAL_CHAR[)]]BLOCK(METHOD_DEF)[SPECIAL_CHAR[{],NEWLINE[n],WHITESPACE[        ],STATEMENT[WORD[System],SPECIAL_CHAR[.],WORD[assert],PARENTHESIS[SPECIAL_CHAR[(],WORD[false],SPECIAL_CHAR[,],WHITESPACE[ ],LITERAL(STRING)['Hello test world!'],SPECIAL_CHAR[)]],SPECIAL_CHAR[;]],NEWLINE[n],WHITESPACE[    ],SPECIAL_CHAR[}]]],NEWLINE[n],NEWLINE[n],WHITESPACE[    ],METHOD[WORD[static]WHITESPACE[ ]WORD[void]WHITESPACE[ ]WORD[test001]PARENTHESIS[SPECIAL_CHAR[(],SPECIAL_CHAR[)]]BLOCK(METHOD_DEF)[SPECIAL_CHAR[{],NEWLINE[n],WHITESPACE[        ],STATEMENT[WORD[Integer],WHITESPACE[ ],WORD[i],SPECIAL_CHAR[=],LITERAL(NUMBER)[0],SPECIAL_CHAR[;]],NEWLINE[n],WHILE_STATEMENT[WORD[while],PARENTHESIS[SPECIAL_CHAR[(],LITERAL(NUMBER)[5],SPECIAL_CHAR[>],WORD[i],SPECIAL_CHAR[)]],BLOCK(MULTI_STATEMENT)[SPECIAL_CHAR[{],NEWLINE[n],WHITESPACE[            ],STATEMENT[WORD[i],SPECIAL_CHAR[++],SPECIAL_CHAR[;]],NEWLINE[n],WHITESPACE[        ],SPECIAL_CHAR[}]]],NEWLINE[n],WHITESPACE[        ],STATEMENT[WORD[return],SPECIAL_CHAR[;]],NEWLINE[n],WHITESPACE[    ],SPECIAL_CHAR[}]]],NEWLINE[n],WHITESPACE[],SPECIAL_CHAR[}]]],NEWLINE[n]]",<commit_msg>update test to adapt actual.<commit_after>package blanco.apex.formatter;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.junit.Test;

import blanco.apex.parser.BlancoApexParserUtil;
import blanco.apex.parser.token.BlancoApexToken;

public class BlancoApexFormatter003Test {
	private static final String TARGET_FILE1 = "./test/data/apex/MySimpleTest2.cls";

	@Test
	public void test() throws IOException {
		final List<BlancoApexToken> tokenList = new BlancoApexFormatter(new BlancoApexFormatterSettings())
				.format(new File(TARGET_FILE1)); //
		if (false)
			System.out.println(BlancoApexParserUtil.tokenList2String(tokenList));
		if (true)
			System.out.println(tokenList.get(0).getDisplayString());

		assertEquals(
				"SOURCE[ANNOTATION[SPECIAL_CHAR[@],WORD[isTest],NEWLINE[n]],CLASS[WORD[public],WHITESPACE[ ],WORD[without],WHITESPACE[ ],WORD[sharing],WHITESPACE[ ],WORD[class],WHITESPACE[ ],WORD[MySimpleTest],WHITESPACE[ ],BLOCK(CLASS_DEF)[SPECIAL_CHAR[{],NEWLINE[n],WHITESPACE[    ],METHOD[WORD[static]WHITESPACE[ ]WORD[testMethod]WHITESPACE[ ]WORD[void]WHITESPACE[ ]WORD[testMain002]PARENTHESIS[SPECIAL_CHAR[(],SPECIAL_CHAR[)]]WHITESPACE[ ]BLOCK(METHOD_DEF)[SPECIAL_CHAR[{],NEWLINE[n],WHITESPACE[        ],STATEMENT[WORD[System],SPECIAL_CHAR[.],WORD[assert],PARENTHESIS[SPECIAL_CHAR[(],WORD[false],SPECIAL_CHAR[,],WHITESPACE[ ],LITERAL(STRING)['Hello test world!'],SPECIAL_CHAR[)]],SPECIAL_CHAR[;]],NEWLINE[n],WHITESPACE[    ],SPECIAL_CHAR[}]]],NEWLINE[n],NEWLINE[n],WHITESPACE[    ],METHOD[WORD[static]WHITESPACE[ ]WORD[void]WHITESPACE[ ]WORD[test001]PARENTHESIS[SPECIAL_CHAR[(],SPECIAL_CHAR[)]]WHITESPACE[ ]BLOCK(METHOD_DEF)[SPECIAL_CHAR[{],NEWLINE[n],WHITESPACE[        ],STATEMENT[WORD[Integer],WHITESPACE[ ],WORD[i],WHITESPACE[ ],SPECIAL_CHAR[=],WHITESPACE[ ],LITERAL(NUMBER)[0],SPECIAL_CHAR[;]],NEWLINE[n],WHITESPACE[        ],WHILE_STATEMENT[WORD[while],WHITESPACE[ ],PARENTHESIS[SPECIAL_CHAR[(],LITERAL(NUMBER)[5],SPECIAL_CHAR[>],WHITESPACE[ ],WORD[i],SPECIAL_CHAR[)]],WHITESPACE[ ],BLOCK(MULTI_STATEMENT)[SPECIAL_CHAR[{],NEWLINE[n],WHITESPACE[            ],STATEMENT[WORD[i],SPECIAL_CHAR[++],SPECIAL_CHAR[;]],NEWLINE[n],WHITESPACE[        ],SPECIAL_CHAR[}]]],NEWLINE[n],WHITESPACE[        ],STATEMENT[WORD[return],SPECIAL_CHAR[;]],NEWLINE[n],WHITESPACE[    ],SPECIAL_CHAR[}]]],NEWLINE[n],WHITESPACE[],SPECIAL_CHAR[}]]],NEWLINE[n]]",
{'fraction_non_alphanumeric': 0.17943292424883622, 'fraction_numerical': 0.006771053745239103, 'mean_word_length': 10.529268292682927, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3955183', 'n_tokens_mistral': 1869, 'n_tokens_neox': 1739, 'n_words': 152}