public void LenTest() { string scriptPath = @"Sample\test.txt"; string scriptBuffer = File.ReadAllText(scriptPath, Encoding.UTF8); Oxygenbasic.O2Basic(scriptBuffer); Oxygenbasic.Mode((int)Enums.Mode.Asciiz); int result = Oxygenbasic.Len(); Assert.IsTrue(result > 0); }
public void ErrorTest() { string scriptPath = @"Sample\test.txt"; string scriptBuffer = File.ReadAllText(scriptPath, Encoding.UTF8); Oxygenbasic.O2Basic(scriptBuffer); Oxygenbasic.Mode((int)Enums.Mode.Asciiz); string result = null; if (Oxygenbasic.Errno() != 0) { result = Oxygenbasic.Error(); } Assert.IsNull(result); }
/// <summary> /// Main /// </summary> /// <param name="args"></param> /// <returns>Returns void.</returns> static void Main(string[] args) { string scriptPath = @"Sample\test_fib.txt"; string scriptBuffer = File.ReadAllText(scriptPath, Encoding.UTF8); Console.WriteLine("O2 Version:" + Oxygenbasic.Version()); Oxygenbasic.O2Basic(scriptBuffer); Oxygenbasic.Mode((int)Enums.Mode.Asciiz); if (Oxygenbasic.Errno() == 0) { Oxygenbasic.Exec(); } else { Console.WriteLine("Error: " + Oxygenbasic.Error()); } Console.ReadKey(); }
public void O2BasicTest() { uint result = Oxygenbasic.O2Basic("int a = 1234"); Assert.IsTrue(result > 0); }