Exemplo n.º 1
0
        public void ScanFailures(string content)
        {
            var input = new TextInputRange {
                File = new TextFile {
                    Content  = content,
                    Filename = ""
                }
            };

            var result = NumberLiteralScanner.Scan(input);

            Assert.IsNull(result);
        }
Exemplo n.º 2
0
        public void ScanSuccess(string content, int radix, string integerPart, string fractionalPart, string exponentPart)
        {
            var input = new TextInputRange {
                File = new TextFile {
                    Content  = content,
                    Filename = ""
                }
            };

            var result = NumberLiteralScanner.Scan(input);

            Assert.IsNotNull(result);
            Assert.AreEqual(radix, result.Radix);
            Assert.AreEqual(integerPart, result.IntegerPart);
            Assert.AreEqual(fractionalPart, result.FractionalPart);
            Assert.AreEqual(exponentPart, result.ExponentPart);
        }