<commit_before># tests.py  06/01/2016  (c) D.J.Whale
#
# Test harness for forth.py

import unittest
import forth

#TODO: Split into to suites, one for the full set of tests,
#another for the test being developed
# can then turn all other tests off while developing new test

class x:#TestForth(unittest.TestCase):
    """A small smoke test - non exhaustive"""
    def setUp(self):
        #print("setup")
        self.f = forth.Forth(outs=forth.Output()).boot()

    def tearDown(self):
        #print("teardown")
        self.f = None

    # very basic test of stack
    def Xtest_000_stack_pushpop(self):
        EXPECTED = 42
        self.f.machine.ds.pushn(EXPECTED)
        actual = self.f.machine.ds.popn()
        self.assertEquals(EXPECTED, actual)

        EXPECTED = 42
        self.f.machine.rs.pushn(EXPECTED)
        actual = self.f.machine.rs.popn()
        self.assertEquals(EXPECTED, actual)


    def test_01_star(self):<commit_msg>All test cases still pass<commit_after># tests.py  06/01/2016  (c) D.J.Whale
#
# Test harness for forth.py

import unittest
import forth

#TODO: Split into to suites, one for the full set of tests,
#another for the test being developed
# can then turn all other tests off while developing new test

class TestForth(unittest.TestCase):
    """A small smoke test - non exhaustive"""
    def setUp(self):
        #print("setup")
        self.f = forth.Forth(outs=forth.Output()).boot()

    def tearDown(self):
        #print("teardown")
        self.f = None

    # very basic test of stack
    def Xtest_000_stack_pushpop(self):
        EXPECTED = 42
        self.f.machine.ds.pushn(EXPECTED)
        actual = self.f.machine.ds.popn()
        self.assertEquals(EXPECTED, actual)

        EXPECTED = 42
        self.f.machine.rs.pushn(EXPECTED)
        actual = self.f.machine.rs.popn()
        self.assertEquals(EXPECTED, actual)


    def test_01_star(self):
{'fraction_non_alphanumeric': 0.11012060828526482, 'fraction_numerical': 0.01782905086523335, 'mean_word_length': 2.719298245614035, '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': '5164139', 'n_tokens_mistral': 648, 'n_tokens_neox': 612, 'n_words': 169}