<commit_before>import unittest

from snoboy import cpu, instructions


class Set(unittest.TestCase):
    def testSet(self):
        bit = 0
        for opcode in range(0xC0, 0xFF, 8):
            cpu.registers.B = 0
            instructions.set(opcode)
            self.assertEquals(cpu.registers.B, 1 << bit)
            bit = bit + 1<commit_msg>Convert test_set to a test generator.<commit_after>from nose.tools import eq_

from snoboy import cpu, instructions


def test_set():
    bit = 0
    for opcode in range(0xC0, 0xFF, 8):
        cpu.registers.B = 0
        instructions.set(opcode)
        yield eq_, cpu.registers.B, 1 << bit
        bit = bit + 1
{'fraction_non_alphanumeric': 0.09393939393939393, 'fraction_numerical': 0.024242424242424242, 'mean_word_length': 2.305, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1326117', 'n_tokens_mistral': 219, 'n_tokens_neox': 208, 'n_words': 62}