Skip to content

Commit

Permalink
Merge pull request #568 from conjure-cp/post-merge-fixes
Browse files Browse the repository at this point in the history
Post merge fixes - dealing with compilation warnings
  • Loading branch information
ozgurakgun committed Jun 12, 2023
2 parents 40ae1e2 + 1ac0782 commit 638782a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
1 change: 0 additions & 1 deletion etc/build/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ set -o errexit
set -o nounset

SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source ${SCRIPT_DIR}/default_envvars.sh

rm -rf dist \
cabal.sandbox.config .cabal-sandbox \
Expand Down
5 changes: 1 addition & 4 deletions src/test/Conjure/Custom.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ import Test.Tasty.HUnit ( testCaseSteps, assertFailure )
import Data.Text.IO as T ( readFile, writeFile )

-- shelly
import Shelly ( cd, bash, errExit, lastStderr,FilePath )

-- system-filepath
import Filesystem.Path.CurrentOS as Path ( fromText )
import Shelly ( cd, bash, errExit, lastStderr )


tests :: IO (TestTimeLimit -> TestTree)
Expand Down
2 changes: 1 addition & 1 deletion src/test/Conjure/ModelAllSolveAll.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import qualified Data.Set as S ( fromList, toList, empty, null, difference )

-- Diff
-- Diff
import Data.Algorithm.Diff ( Diff(..), getGroupedDiff, PolyDiff (..) )
import Data.Algorithm.Diff ( getGroupedDiff, PolyDiff (..) )
import Data.Algorithm.DiffOutput ( ppDiff )


Expand Down
20 changes: 8 additions & 12 deletions src/test/Conjure/ParserFuzz.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,24 @@ import Conjure.Prelude

-- tasty
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (assertFailure, testCaseSteps, assertEqual)
import Test.Tasty.HUnit (assertFailure, testCaseSteps)

import Conjure.Language.Parser (runLexerAndParser)
import Conjure.Language.AST.ASTParser (runASTParser, parseProgram)
import Conjure.Language.Lexer (runLexer, Reformable (reform), reformList)
import qualified Data.Text as T (pack, lines, unpack)
import qualified Data.Text.Lazy as L
import Data.ByteString.Char8(hPutStrLn, pack, unpack)
import Conjure.Language.Lexer (runLexer, reformList)
import qualified Data.Text as T (pack, unpack)
import qualified Data.Text.Lazy as L
import Data.ByteString.Char8(hPutStrLn, pack)
import Conjure.Language.AST.Reformer (Flattenable(flatten))
import Data.Algorithm.Diff (getDiff, getGroupedDiff)
import Data.Algorithm.Diff (getGroupedDiff)
import Data.Algorithm.DiffOutput (ppDiff)
import GHC.IO.Handle.FD (stderr)
import System.Console.CmdArgs.Helper (execute)
import Shelly (run, shelly, silently)


tests :: IO TestTree
tests = do
let baseDir = "tests"
allFiles <- shelly $ silently $ run "git" ["ls-tree", "--full-tree", "--name-only", "-r", "HEAD"]
let allFileList = lines $ T.unpack allFiles
-- contents <- mapM readFileIfExists allFileList
let testCases = testFile <$> allFileList
return (testGroup "parse_fuzz" testCases)

Expand All @@ -42,11 +38,11 @@ testFile fp = testCaseSteps (map (\ch -> if ch == '/' then '.' else ch) fp) $ \s
let usableFileData = concat (take 1000 . lines $ fromMaybe [] fd)
let fText = T.pack usableFileData
case runLexer $ fText of
Left le -> assertFailure $ "Lexer failed in:" ++ fp
Left _le -> assertFailure $ "Lexer failed in:" ++ fp
Right ets -> do
step "parsing"
case runASTParser parseProgram ets of
Left pe -> assertFailure $ "Parser failed in:" ++ fp
Left _pe -> assertFailure $ "Parser failed in:" ++ fp
Right pt -> do
step "RoundTripping"
let roundTrip = L.unpack $ reformList $ flatten pt
Expand Down

0 comments on commit 638782a

Please sign in to comment.