<commit_before>package de.learnlib.algorithms.angluin;

import de.learnlib.algorithms.angluin.oracles.SimpleOracle;
import de.learnlib.api.LearningAlgorithm;
import de.ls5.automata.fsa.DFA;
import de.ls5.words.Alphabet;
import de.ls5.words.Word;
import de.ls5.words.impl.ArrayWord;
import de.ls5.words.impl.FastAlphabet;
import de.ls5.words.impl.Symbol;
import de.ls5.words.util.Words;
import org.junit.Assert;
import org.testng.annotations.Test;

public class TestSimpleAutomaton {

	@Test
	public void test() {
		Alphabet<Symbol> alphabet = new FastAlphabet<Symbol>();
		Symbol zero = new Symbol(0);
		Symbol one = new Symbol(1);

		alphabet.add(zero);
		alphabet.add(one);

		LearningAlgorithm<DFA, Symbol, Boolean> angluin = new Angluin<Symbol>(alphabet, new SimpleOracle());
		DFA hypothesis = angluin.createHypothesis();

		Assert.assertEquals(hypothesis.getStates().size(), 2);

		Word<Symbol> counterExample = new ArrayWord<Symbol>();
		counterExample = Words.append(counterExample, one, one, zero);

		hypothesis = angluin.refineHypothesis(counterExample, false);
		Assert.assertEquals(hypothesis.getStates().size(), 4);
	}

}<commit_msg>Cleaning up tests<commit_after>package de.learnlib.algorithms.angluin;

import de.learnlib.algorithms.angluin.oracles.SimpleOracle;
import de.learnlib.api.LearningAlgorithm;
import de.ls5.automata.fsa.DFA;
import de.ls5.words.Alphabet;
import de.ls5.words.Word;
import de.ls5.words.impl.ArrayWord;
import de.ls5.words.impl.FastAlphabet;
import de.ls5.words.impl.Symbol;
import de.ls5.words.util.Words;
import org.junit.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class TestSimpleAutomaton {

	private Symbol zero;
	private Symbol one;

	private LearningAlgorithm<DFA, Symbol, Boolean> angluin;

	@BeforeClass
	public void setup() {
		Alphabet<Symbol> alphabet = new FastAlphabet<Symbol>();
		zero = new Symbol(0);
		one = new Symbol(1);

		alphabet.add(zero);
		alphabet.add(one);

		angluin = new Angluin<Symbol>(alphabet, new SimpleOracle());
	}

	@Test
	public void testFirstHypothesis() {
		DFA hypothesis = angluin.createHypothesis();
		Assert.assertEquals(hypothesis.getStates().size(), 2);
	}

	@Test(dependsOnMethods = "testFirstHypothesis")
	public void testCounterExample() {
		Word<Symbol> counterExample = new ArrayWord<Symbol>();
		counterExample = Words.append(counterExample, one, one, zero);

		DFA hypothesis = angluin.refineHypothesis(counterExample, false);
		Assert.assertEquals(hypothesis.getStates().size(), 4);
	}

}
{'fraction_non_alphanumeric': 0.12692156089869924, 'fraction_numerical': 0.008671659440283799, 'mean_word_length': 5.609375, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '146158', 'n_tokens_mistral': 910, 'n_tokens_neox': 841, 'n_words': 164}