This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit tests for all Frege modules
otherwise gradle build will fail due to Frege/frege-gradle-plugin#39
- Loading branch information
Showing
10 changed files
with
80 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
cspmparser/CSPM-Frontend/src/test/frege/Language/CSPM/UnicodeSymbolsTest.fr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Language.CSPM.UnicodeSymbolsTest | ||
where | ||
|
||
import Test.QuickCheck | ||
|
||
import Data.Maybe | ||
import Language.CSPM.UnicodeSymbols | ||
|
||
test :: Property | ||
test = once $ lookupDefaultSymbol (fromJust $ lookupToken '⟷') == Just ('⟷', "<->") |
10 changes: 10 additions & 0 deletions
10
cspmparser/CSPM-ToProlog/src/test/frege/Language/CSPM/VersionTest.fr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Language.CSPM.VersionTest | ||
where | ||
|
||
import Test.QuickCheck | ||
|
||
import Language.CSPM.TranslateToProlog | ||
import Data.Version | ||
|
||
test :: Property | ||
test = once $ showVersion toPrologVersion == "0.6.1.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
cspmparser/CSPM-cspm-frontend/src/test/frege/Main/VersionTest.fr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Main.ExecCommandTest | ||
|
||
where | ||
|
||
import Test.QuickCheck | ||
|
||
import Main.ExecCommand | ||
import Data.Version | ||
|
||
test :: Property | ||
test = once $ showVersion cmdVersion == "0.1.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package frege.data.SetTest where | ||
|
||
import Test.QuickCheck | ||
|
||
import frege.data.Set | ||
|
||
singletonTest :: Property | ||
singletonTest = once $ insert 1 empty == singleton 1 |
22 changes: 22 additions & 0 deletions
22
cspmparser/Parsec/src/test/frege/Text/ParserCombinators/Parsec/ParsecTest.fr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Text.ParserCombinators.Parsec.ParsecText where | ||
|
||
import Test.QuickCheck | ||
|
||
import Text.ParserCombinators.Parsec.Parsec | ||
import Text.ParserCombinators.Parsec.Token | ||
import Text.ParserCombinators.Parsec.Language | ||
|
||
csvLine :: Parser [String] | ||
csvLine = csvCell `sepBy` (haskell.comma) | ||
|
||
csvCell :: Parser String | ||
csvCell = do | ||
cell <- many $ noneOf ",\n" | ||
return $ packed cell | ||
|
||
parseCsvLine :: String -> Either ParseError [String] | ||
parseCsvLine str = parse csvLine "" (unpacked str) | ||
|
||
test :: Property | ||
test = let Right result = parseCsvLine "Foo,Bar" in | ||
once $ result == ["Foo", "Bar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Text where | ||
|
||
import Test.QuickCheck | ||
|
||
-- only here so that gradle build does not fail (https://github.com/Frege/frege-gradle-plugin/issues/39) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Text.XML.Light.Test where | ||
|
||
import Test.QuickCheck | ||
|
||
import frege.control.monad.MState | ||
|
||
simpleTest :: Property | ||
simpleTest = once $ runState (return 'X') 1 == ('X', 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Text.XML.Light.Test where | ||
|
||
import Test.QuickCheck | ||
|
||
-- only here so that gradle build does not fail (https://github.com/Frege/frege-gradle-plugin/issues/39) |