Example #1
0
        public void CanHandleDescriptorAndOpeningBraceInDifferentLines()
        {
            string input = @"#a
            {
            outline: 1px solid red;
            }";
            string desiredOutput = "#a{outline:1px solid red;}";
            var processor = new Processor(input);
            char[] output = processor.Output;

            Console.WriteLine(desiredOutput);
            Console.WriteLine(output);

            Assert.AreEqual(desiredOutput, output);
        }
Example #2
0
        public void ExtendedTest()
        {
            string input =
                @"@a: 2;
            @x: @a * @a;
            @y: @x + 1;
            @z: @x * 2 + @y;

            .variables {
              width: @z + 1cm; // 14cm
            }

            @b: @a * 10;
            @c: #888;
            @fonts: ""Trebuchet MS"", Verdana, sans-serif;

            .variables {
              height: @b + @x + 0px; // 24px
              color: @c;
              font-family: @fonts;
            }";
            string desiredOutput =
                @".variables{width:@z+1cm;}.variables{height:@b+@x+0px;color:@c;font-family:@fonts;}@a:2;@x:@a*@a;@y:@x+1;@z:@x*2+@y;@b:@a*10;@c:#888;@fonts:""Trebuchet MS"",Verdana,sans-serif;";
            var preprocessor = new Processor(input);
            char[] output = preprocessor.Output;
            Console.WriteLine(desiredOutput);
            Console.WriteLine(output);

            Assert.AreEqual(desiredOutput, output);
        }