Пример #1
0
    static async Task Main(string[] args)
    {
        if (args.Length == 1)
        {
            if (args[0] == "testbed")
            {
                var stopwatch = new System.Diagnostics.Stopwatch();
                stopwatch.Start();
                await TestBed.Run();

                Console.WriteLine($"Done in {stopwatch.ElapsedMilliseconds} ms");
            }
            // else if (args[0] == "benchmark") {
            //     Benchmarks.Run();
            // }
            else
            {
                Console.WriteLine($"Unknown command \"{args[0]}\"");
            }
        }
        else
        {
            var scriptText = args.Length switch {
                0 => GetAllInput(),
                2 => args[0] switch {
                    "file" => await File.ReadAllTextAsync(args[1], Encoding.UTF8),
                    "command" => args[1],
                    _ => throw new ArgumentException($"Unknown type {args[0]}, expecting (file|command)")
                },
Пример #2
0
    public void OnTestClicked()
    {
        Assembly result = Compile();

        if (result != null)
        {
            TestBed tester = (TestBed)result.CreateInstance("Test");
            Console.Write("\n");
            tester.Run();
        }
        Console.NewPrompt();
    }
Пример #3
0
        static void Main(string[] args)
        {
            var tests = new TestBed();

            tests.Run();
        }
Пример #4
0
 static void Main(string[] args)
 {
     var tests = new TestBed();
     tests.Run();
 }