getTest :: String -> Bool -> IO Test
getTest testName keepLV = do
  opts <- getOptions testName keepLV
  let result = parakeet opts TeXFormat
  output <- case result of
                 Left err -> throw err
                 Right r  -> return (lines r)
  expect <- lines <$> IO.readFile ("test-expect/" ++ testName ++ ".tex.expect")
  return $ TestLabel testName $ TestCase $ do
    let nlines = length expect
    let singleLineTest (l, e, o) = assertEqual ("On line " ++ show (l + 1)) e o
    assertEqual "The number of lines" nlines (length output)
    mapM_ singleLineTest $ zip3 [0 .. nlines - 1] expect output
getTest :: String -> Bool -> IO Test
getTest testName keepLV = do
  opts <- getOptions testName keepLV
  let result = parakeet opts TeXFormat
  output <- case result of
                 Left err -> throw err
                 Right r  -> return (lines r)
  expect <- lines <$> IO.readFile ("test-expect/" ++ testName ++ ".tex.expect")
  return $ TestLabel testName $ TestCase $ do
    let nlines = length expect
    let singleLineTest (l, e, o) = assertEqual ("On line " ++ show (l + 1)) e o
    assertEqual "The number of lines" nlines (length output)
    mapM_ singleLineTest $ zip3 [0 .. nlines - 1] expect output
getTest testName keepLV = do
  opts <- getOptions testName keepLV
  let result = parakeet opts TeXFormat
  output <- case result of
                 Left err -> throw err
                 Right r  -> return (lines r)
  expect <- lines <$> IO.readFile ("test-expect/" ++ testName ++ ".tex.expect")
  return $ TestLabel testName $ TestCase $ do
    let nlines = length expect
    let singleLineTest (l, e, o) = assertEqual ("On line " ++ show (l + 1)) e o
    assertEqual "The number of lines" nlines (length output)
    mapM_ singleLineTest $ zip3 [0 .. nlines - 1] expect output