discard """ output: ''' [Suite] nimgrep filesystem [Suite] nimgrep contents filtering ''' """ ## Authors: quantimnot, a-mr import osproc, os, streams, unittest, strutils #======= # setup #======= var process: Process var ngStdOut, ngStdErr: string var ngExitCode: int let previousDir = getCurrentDir() let tempDir = getTempDir() let testFilesRoot = tempDir / "nimgrep_test_files" template nimgrep(optsAndArgs): untyped = process = startProcess(previousDir / "bin/nimgrep " & optsAndArgs, options = {poEvalCommand}) ngExitCode = process.waitForExit ngStdOut = process.outputStream.readAll ngStdErr = process.errorStream.readAll func fixSlash(s: string): string = if DirSep == '/': result = s else: # on Windows result = s.replace('/', DirSep) func initString(len = 1000, val = ' '): string = result = newString(len) for i in 0..