31 lines
915 B
C#
31 lines
915 B
C#
using System;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using System.Collections.Generic;
|
|
using Axiom.Utils;
|
|
using Axiom.Interpreter;
|
|
using System.IO;
|
|
|
|
namespace AxiomUnitTestProject
|
|
{
|
|
[TestClass]
|
|
public class ScannerTests
|
|
{
|
|
[TestMethod]
|
|
public void ScannerShouldScan()
|
|
{
|
|
List<String> codeLines = TestData.CodeLines();
|
|
foreach(String expression in codeLines)
|
|
{
|
|
BinaryWriter binaryWriter=new BinaryWriter(new MemoryStream());
|
|
SymbolTable symbolTable = new SymbolTable();
|
|
BinaryReader binaryReader = null;
|
|
binaryReader = new BinaryReader(Utility.StreamFromString(expression));
|
|
Scanner scanner = new Scanner(binaryReader, binaryWriter, symbolTable);
|
|
Console.WriteLine("Expression:\""+expression+"\"");
|
|
Assert.IsTrue(scanner.Analyze());
|
|
Console.WriteLine("**************************");
|
|
}
|
|
}
|
|
}
|
|
}
|