예제 #1
0
    def test_lshift(self):
        signal_state = {
            'x': 123
        }

        signal_state = apply_rule(signal_state, 'x LSHIFT 2 -> f')
        self.assertEqual(492, signal_state['f'])
예제 #2
0
    def test_or_withSetSignals_setsValueToSignal(self):
        signal_state = {
            'a': 1,
            'b': 2
        }

        signal_state = apply_rule(signal_state, 'a OR b -> c')
        self.assertEqual(3, signal_state['c'])
예제 #3
0
    def test_assign_withUnknownSignal_setsValueToSignal(self):
        signal_state = {}
        signal_state = apply_rule(signal_state, '123 -> a')

        self.assertEqual(123, signal_state['a'])