Exemple #1
0
        public void TestAllSqlFiles()
        {
            var sqlFolder = @"D:\VDisk\MyGitHub\SQL";
            var p         = new SqlParser();
            var fileCount = 0;

            foreach (var sqlFile in ReadSqlFiles(sqlFolder))
            {
                var sql = File.ReadAllText(sqlFile);
                try
                {
                    _outputHelper.WriteLine($"parsing='{sqlFile}'");
                    p.ParseAll(sql).ToList();
                }
                catch
                {
                    _outputHelper.WriteLine($"parsedCount={fileCount}");
                    _outputHelper.WriteLine($"'{sqlFile}'");
                    throw;
                }
                fileCount++;
            }
            _outputHelper.WriteLine($"Total parsed Count={fileCount}");
            _outputHelper.WriteLine($"=== END ===");
        }