Esempio n. 1
0
        public void AnotherFailingTestsInKata()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile("[*>[>*>]>]", "11001");

            Assert.That(result, Is.EqualTo("01100"));
        }
Esempio n. 2
0
        public void BrokeSomethingAgain()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile("*>*>>>*>*>>>>>*[>*]", "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");

            Assert.That(result, Is.EqualTo("1100110000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"));
        }
Esempio n. 3
0
        public void FlippingCodeShouldFlipTape()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile("*", "00101100");

            Assert.That(result, Is.EqualTo("10101100"));
        }
Esempio n. 4
0
        public void FailingTestsInKata()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile("[[]*>*>*>]", "000");

            Assert.That(result, Is.EqualTo("000"));
        }
Esempio n. 5
0
        public void JumpPastBracketIfZero()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile("*>[>*]*", "00101100");

            Assert.That(result, Is.EqualTo("11101100"));
        }
Esempio n. 6
0
        public void FlipsOneBits()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile(">>>>>*<*<<*", "00101100");

            Assert.That(result, Is.EqualTo("00000000"));
        }
Esempio n. 7
0
        public void FlipsZeroBits()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile("*>*>>*>>>*>*", "00101100");

            Assert.That(result, Is.EqualTo("11111111"));
        }
Esempio n. 8
0
        public void FlipsSecondAndThirdPositionOfTheCell()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile(">*>*", "00101100");

            Assert.That(result, Is.EqualTo("01001100"));
        }
Esempio n. 9
0
        public void LoopShouldExecuteProperly()
        {
            var interpreter = new SmallFuck();
            var result      = interpreter.Compile("*[>*]",
                                                  "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");

            Assert.That(result,
                        Is.EqualTo(
                            "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"));
        }