Commit 492e104d authored by Kai-Oliver Prott's avatar Kai-Oliver Prott
Browse files

Modify for base-2.0.0

parent 83fe0dfc
......@@ -5,17 +5,16 @@
"synopsis": "The standard preprocessor of Curry",
"category": [ "Programming", "Analysis" ],
"dependencies": {
"base" : ">= 1.0.0, < 2.0.0",
"abstract-curry": ">= 2.0.0",
"cass-analysis" : ">= 2.0.0",
"cass" : ">= 2.0.0",
"cdbi" : ">= 2.0.0",
"currycheck" : ">= 2.0.0",
"abstract-curry": ">= 3.0.0",
"cass-analysis" : ">= 3.0.0",
"cass" : ">= 3.0.0",
"cdbi" : ">= 3.0.0",
"currycheck" : ">= 3.0.0",
"fl-parser" : ">= 1.0.0",
"html" : ">= 2.0.0",
"regexp" : ">= 1.1.0",
"wl-pprint" : ">= 0.0.1",
"xml" : ">= 2.0.0"
"html" : ">= 3.0.0",
"regexp" : ">= 2.0.0",
"wl-pprint" : ">= 2.0.0",
"xml" : ">= 3.0.0"
},
"compilerCompatibility": {
"pakcs": ">= 2.0.0",
......
......@@ -23,5 +23,3 @@ sort'post xs ys = length xs == length ys
sort7 = sort (map showInt [7,1,6,3,5,4,2]) -=- map (\d -> "+00"++show d) [1..7]
sortEmpty = toError (sort ([] :: [Int]))
......@@ -22,19 +22,20 @@ import AbstractCurry.Pretty
import AbstractCurry.Build
import AbstractCurry.Select
import AbstractCurry.Transform
import Char
import ContractUsage
import Directory
import System.Directory
import System.Process
import System.Environment (getArgs)
import System.FilePath (takeDirectory)
import Distribution
import FilePath (takeDirectory)
import List
import Maybe (fromJust, isNothing)
import System
import Data.List
import Data.Char
import Data.Maybe (fromJust, isNothing)
-- in order to use the determinism analysis:
import Analysis.ProgInfo (ProgInfo, lookupProgInfo)
import Analysis.Deterministic (Deterministic(..), nondetAnalysis)
import CASS.Server (analyzeGeneric)
import Analysis.ProgInfo (ProgInfo, lookupProgInfo)
import Analysis.Deterministic (Deterministic(..), nondetAnalysis)
import CASS.Server (analyzeGeneric)
import SimplifyPostConds
import TheoremUsage
......@@ -187,7 +188,7 @@ transformCProg verb opts srctxt orgprog outmodname = do
putStrLn $ "Adding contract checking to: " ++ unwords checkfuns
detinfo <- analyzeGeneric nondetAnalysis (progName prog)
>>= return . either id error
let newprog = transformProgram opts funposs fdecls detinfo
let newprog = transformProgram opts funposs fdecls detinfo
funspecs preconds postconds prog
return (Just (renameCurryModule outmodname newprog))
......@@ -370,11 +371,11 @@ addContract opts funposs allfdecls predecls postdecls
addCmtLine "Without precondition checking!" $
rnmFDecl rename fdecl))
(find (\fd -> fromPreCondName (snd (funcName fd)) == f) predecls)
-- Construct function with postcond. added and a function without postc.:
(postcheck,wopostfdecl) =
maybe ([],woprefdecl)
(\postdecl ->
(\postdecl ->
let postname = funcName postdecl
qnp = funcName woprefdecl
rename = updateFunc id qnp
......@@ -502,10 +503,10 @@ renameProp2EasyCheck prog =
--- Name of the Test.Prop module (the clone of the EasyCheck module).
propModule :: String
propModule = "Test.Prop"
propModule = "Test.Prop"
--- Name of the EasyCheck module.
easyCheckModule :: String
easyCheckModule = "Test.EasyCheck"
easyCheckModule = "Test.EasyCheck"
------------------------------------------------------------------------
......@@ -4,7 +4,7 @@ import Test.EasyCheck
-- Example: predicate to check for float strings
import Char(isDigit)
import Data.Char (isDigit)
-- Is the argument a non-negative float string (without exponent)?
isNNFloat :: String -> Bool
......@@ -15,4 +15,3 @@ main = map isNNFloat ["3.14","314"]
test1 = isNNFloat "3.14" -=- True
test2 = isNNFloat "314" -=- False
......@@ -5,7 +5,7 @@ import Test.EasyCheck
-- Example: parse World Cup soccer scores (e.g., "_:_", "3:2")
import Char(isDigit)
import Data.Char (isDigit)
parse (team1++" _:_ "++team2) = (team1, team2, Nothing)
parse (team1++[' ',x,':',y,' ']++team2)
......
......@@ -11,14 +11,14 @@ import AbstractCurry.Files
import AbstractCurry.Select
import AbstractCurry.Build
import AbstractCurry.Pretty
import Char(isDigit,digitToInt)
import DefaultRuleUsage
import Directory
import Data.Char (isDigit,digitToInt)
import Data.List(isPrefixOf,isSuffixOf,partition)
import System.Directory
import System.FilePath (takeDirectory)
import System.Process
import Distribution
import FilePath (takeDirectory)
import List(isPrefixOf,isSuffixOf,partition)
import System
import TheoremUsage
import DefaultRuleUsage
--------------------------------------------------------------------
......@@ -320,7 +320,7 @@ transDefaultRule condfunname ar (CRule pats (CSimpleRhs exp locals)) =
(CSymbol condfunname : args)]
(newpats,args) = unzip (map arg2patexp (zip [1001..] pats))
arg2patexp (i,pat) = case pat of
CPVar v -> if snd v=="_"
then let newvar = (i,"patvar_"++show i)
......@@ -329,7 +329,7 @@ transDefaultRule condfunname ar (CRule pats (CSimpleRhs exp locals)) =
CPAs asv _ -> (pat, CVar asv)
_ -> let newvar = (i,"patvar_"++show i)
in (CPAs newvar pat, CVar newvar)
------------------------------------------------------------------------
preUnit :: CExpr
......
......@@ -7,8 +7,8 @@
------------------------------------------------------------------------------
module CIParser(parse) where
import List
import Char
import Data.List
import Data.Char
import ParseTypes
......
......@@ -35,4 +35,3 @@ printFl f = ``printf "% 20.4f\n",f''
printEl :: Float -> IO ()
printEl f = do ``printf "%+20.3E",f'' >> putStr " meters\n"
putStrLn "DONE!"
......@@ -39,7 +39,7 @@ testEx3 = (ex3 'a') -=- "This is a char: a"
-- Integer and character formatting:
testIntFixedSignedChar = ``format "%+5d%c",42,c'' -=- " +42%"
where
c = '%'
c = '%'
-- Format a string with a given width and maximal length:
ex4 :: String -> String
......@@ -57,7 +57,7 @@ test_intexp = (ex8 42 2143) -=- "The sum of +00042 and +2143 is +2185.\n"
testFloatFixPrec3 = ``format "%+8.3f",f'' -=- " +3.142"
where
f = 3.14159
-- Format a float with an exponent:
testFloatExp = ``format "% .4E",f'' -=- " 3.1416E+02"
where
......
import Uni
import Database.CDBI.ER
import Database.CDBI.ER
import Database.CDBI.Connection
import Time
import Data.Time
--- Creates the test data for Uni database.
main :: IO ()
main = runJustT $ do
setForeignKeyCheck False
insertEntries student_CDBI_Description studentList
insertEntries student_CDBI_Description studentList
insertEntries lecturer_CDBI_Description lecturerList
insertEntries lecture_CDBI_Description lectureList
insertEntries place_CDBI_Description placeList
insertEntries time_CDBI_Description timeList
insertEntries exam_CDBI_Description examList
insertEntries result_CDBI_Description resultList
insertEntries lecture_CDBI_Description lectureList
insertEntries place_CDBI_Description placeList
insertEntries time_CDBI_Description timeList
insertEntries exam_CDBI_Description examList
insertEntries result_CDBI_Description resultList
insertEntryCombined sseDescription sse1
insertEntries participation_CDBI_Description participList
setForeignKeyCheck True
......@@ -52,7 +52,7 @@ lectureList = [lecture1, lecture2, lecture3]
"This lecture provides an introduction to databases and SQL."
(LecturerID 3)
-- Places
-- Places
placeList :: [Uni.Place]
placeList = [place1, place2]
where
......@@ -76,60 +76,60 @@ examList = [exam1, exam2, exam3, exam4]
exam2 = Exam (ExamID 2) (Just 3.3) (LectureID 1) (TimeID 2) (PlaceID 2)
exam3 = Exam (ExamID 3) (Just 1.7) (LectureID 2) (TimeID 3) (PlaceID 1)
exam4 = Exam (ExamID 4) Nothing (LectureID 3) (TimeID 4) (PlaceID 2)
-- Results
resultList :: [Uni.Result]
resultList =
[result1, result2, result3, result4, result5, result6, result7, result8]
where
result1 = Result (ResultID 1) 1 (Just 5.0) (Just 30) (StudentID 1) (ExamID 1)
result2 = Result (ResultID 2) 2 (Just 3.7) (Just 58) (StudentID 1) (ExamID 2)
result3 = Result (ResultID 3) 1 (Just 1.0) (Just 97) (StudentID 2) (ExamID 1)
result2 = Result (ResultID 2) 2 (Just 3.7) (Just 58) (StudentID 1) (ExamID 2)
result3 = Result (ResultID 3) 1 (Just 1.0) (Just 97) (StudentID 2) (ExamID 1)
result4 = Result (ResultID 4) 1 (Just 1.3) (Just 90) (StudentID 3) (ExamID 1)
result5 = Result (ResultID 5) 1 (Just 1.3) (Just 91) (StudentID 1) (ExamID 3)
result6 = Result (ResultID 6) 1 (Just 5.0) (Just 20) (StudentID 4) (ExamID 1)
result7 = Result (ResultID 7) 2 (Just 5.0) (Just 39) (StudentID 4) (ExamID 2)
result8 = Result (ResultID 8) 1 (Just 5.0) (Just 49) (StudentID 4) (ExamID 3)
cd :: CombinedDescription CreateData.StudentStudentExam
cd = combineDescriptions student_CDBI_Description 0 exam_CDBI_Description 0
(\st ex -> (StudentStudentExam _ st ex))
(\(StudentStudentExam _ st ex) -> (st, ex))
data StudentStudentExam = StudentStudentExam Student Student Exam
sseDescription :: CombinedDescription CreateData.StudentStudentExam
sseDescription =
addDescription student_CDBI_Description 1
sseDescription =
addDescription student_CDBI_Description 1
(\st1 (StudentStudentExam _ st2 ex) -> (StudentStudentExam st1 st2 ex))
(\(StudentStudentExam st _ _) -> st) cd
sse1 :: StudentStudentExam
sse1 :: StudentStudentExam
sse1 =
StudentStudentExam
(Student (StudentID 5) "Mond" "Thorben" 55 "thorben@email.de" (Just 18))
(Student (StudentID 6) "Stern" "Susanne" 77 "susanne@email.de" (Just 18))
(Exam (ExamID 5) (Just 2.2) (LectureID 3) (TimeID 2) (PlaceID 1))
participList::[Participation]
participList::[Participation]
participList = [particip1, particip2, particip3, particip4, particip5,
particip6, particip7, particip8, particip9]
where
particip1 :: Participation
particip1 = Participation (StudentID 1) (LectureID 1)
particip1 = Participation (StudentID 1) (LectureID 1)
particip2 :: Participation
particip2 = Participation (StudentID 2) (LectureID 1)
particip2 = Participation (StudentID 2) (LectureID 1)
particip3 :: Participation
particip3 = Participation (StudentID 1) (LectureID 2)
particip3 = Participation (StudentID 1) (LectureID 2)
particip4 :: Participation
particip4 = Participation (StudentID 3) (LectureID 2)
particip4 = Participation (StudentID 3) (LectureID 2)
particip5 :: Participation
particip5 = Participation (StudentID 4) (LectureID 2)
particip5 = Participation (StudentID 4) (LectureID 2)
particip6 :: Participation
particip6 = Participation (StudentID 1) (LectureID 3)
particip6 = Participation (StudentID 1) (LectureID 3)
particip7:: Participation
particip7 = Participation (StudentID 2) (LectureID 3)
particip7 = Participation (StudentID 2) (LectureID 3)
particip8 :: Participation
particip8 = Participation (StudentID 5) (LectureID 3)
particip8 = Participation (StudentID 5) (LectureID 3)
particip9 :: Participation
particip9 = Participation (StudentID 6) (LectureID 3)
\ No newline at end of file
particip9 = Participation (StudentID 6) (LectureID 3)
......@@ -4,7 +4,7 @@
--- Checking whether the preprocessor detects errors
import Database.CDBI.ER as C
import Time
import Data.Time
import Uni
-- "Scanner" errors
......@@ -15,13 +15,13 @@ testE0 =``sql Select * from Student where Age > 20 & Age < 30;''
-- Parsing errors
--missing semicolon
testE1 :: IO(SQLResult [Student])
testE1 =``sql Select * From Student''
testE1 =``sql Select * From Student''
-- missing table pseudony in Satisfies and missing parenthesis in first condition
testE2 :: IO(SQLResult [(String, String)])
testE2 =``sql Select s.Firstname, s.Email
From Student As s Inner Join Result as r On Satisfies has_a r
Where (r.Attempt = 1 And r.Grade <= 3.0 Or
From Student As s Inner Join Result as r On Satisfies has_a r
Where (r.Attempt = 1 And r.Grade <= 3.0 Or
(r.Attempt = 2 And r.Grade = 1.0);''
-- missing and in between operator
......@@ -47,13 +47,13 @@ testE6 student =``sql Insert Into Student {student};''
-- too much parenthesis surrounding values
testE7 :: IO( SQLResult ())
testE7 =``sql Insert Into Student Values
testE7 =``sql Insert Into Student Values
((10, 2608, "Wulf", "Malte", "mwu@mail.de", 34),
(11, 4736 ,"Krause", "Johanna", "jek@mail.de", 25));''
-- missing into keyword
testE8 :: IO( SQLResult ())
testE8 =``sql Insert Student Values
testE8 =``sql Insert Student Values
(8, 6828, "Julia", "Krone", "julia@mail.de", 26);''
-- using alias in delete query
......@@ -62,7 +62,7 @@ testE81 studName =``sql Delete From Student s Where s.Name = {studName};''
-- missing semicolon
testE82 :: IO( SQLResult ())
testE82 =``sql Insert Into Student Values
testE82 =``sql Insert Into Student Values
(8, 6828, "Julia", "Krone", "julia@mail.de", 26)''
-- SQL/consistency errors
......@@ -80,8 +80,8 @@ testColumns1 = ``sql Select Student.Name, Student.Name from Student, Student;''
-- Point-column has typo and is withour pseudonym and result can not be used in Satisfies
testE9 :: IO( SQLResult [(String, (Maybe Int))])
testE9 = ``sql Select s.Name, r.Points From Student
as s, Result as r Where Point > 45 and Satisfies s has_a result;''
testE9 = ``sql Select s.Name, r.Points From Student
as s, Result as r Where Point > 45 and Satisfies s has_a result;''
-- Alias s defined twice
testE91 :: IO(SQLResult [(String, String)])
......@@ -99,51 +99,51 @@ testE93 = ``sql Select s.Name from Student where exists (Select * from Result as
-- Point has a typo, undefined relation used
testE94 :: IO( SQLResult [(String, (Maybe Int))])
testE94 = ``sql Select s.Name, r.Points From Student
testE94 = ``sql Select s.Name, r.Points From Student
as s, Result as r Where r.Point > 45 and Satisfies s belongs_to r;''
-- alias defined but not used for age
testSE11 :: IO( SQLResult [(String, (Maybe Int))])
testSE11 ``sql Select s.FirstName, s.Age from Student as s Where Age not null;''
testSE11 ``sql Select s.FirstName, s.Age from Student as s Where Age not null;''
-- typo in table name
testE12 :: IO( SQLResult [Student])
testE12 = ``sql Select * From Students;''
testE12 = ``sql Select * From Students;''
-- constraint not allowed
testSE13 :: IO( SQLResult [(String, (Maybe Int))])
testSE13 = ``sql Select s.Firstname, s.Age from Student as s Where s.Age = Null;''
testSE13 = ``sql Select s.Firstname, s.Age from Student as s Where s.Age = Null;''
-- this one at least results in an type error
-- missing values for e-mail which con not be null
testE14 :: IO( SQLResult ())
testE15 = ``sql Insert Into Student Values
(8, 6828, "Julia", "Krone", 26);''
-- missing value for column matnum
testE15 = ``sql Insert Into Student Values
(8, 6828, "Julia", "Krone", 26);''
-- missing value for column matnum
testE15 :: IO( SQLResult ())
testE15 = ``sql Insert Into Student
testE15 = ``sql Insert Into Student
(Key, Name, Firstname, Email, Age)
Values (9,"Susan", "Krone", "susan@mail.de", 17);''
-- non existent column given
testE16 :: IO( SQLResult ())
testE16 = ``sql Insert Into Student
testE16 = ``sql Insert Into Student
(Key, MatNum, Name, Firstname, Career, Age)
Values (9, 2001 ,"Susan", "Krone", "Informatik", 17);''
-- keys are referencing different tables
testE9' :: IO(SQLResult [(Student, Result)])
testE9' =``sql Select Distinct * From Student As s , Result as r
testE9' =``sql Select Distinct * From Student As s , Result as r
Where r.StudentTakingKey = r.Key
Limit 5;''
Limit 5;''
-- type errors
-- keys compared to values
testE10 :: IO(SQLResult [Student])
testE10 = ``sql Select Distinct * From Student As s
testE10 = ``sql Select Distinct * From Student As s
Where Exists
( Select * From Participation As p
( Select * From Participation As p
Where s.Key = p.StudentParticipationKey And p.LectureParticipationKey
In (1,2,3)) Limit 5;''
......@@ -157,41 +157,41 @@ testE17' =``sql Select Name, MatNum From Student Union Select Name From Lecturer
-- Points is of type Int
testE18 :: IO( SQLResult [(String, (Maybe Int))])
testE18 = ``sql Select s.Name, r.Points From Student
as s, Result as r Where r.Points > 45.5 and Satisfies s has_a r;''
testE18 = ``sql Select s.Name, r.Points From Student
as s, Result as r Where r.Points > 45.5 and Satisfies s has_a r;''
-- StudentID compared with column of type Int
testE19 :: IO( SQLResult [String])
testE19 = ``sql Select s.Name From Result As r, Student As s
testE19 = ``sql Select s.Name From Result As r, Student As s
Where s.Key = r.Points Group By s.Name Having r.Grade < 2.0;''
-- Column of type String inside avg function
testE20 :: IO(SQLResult [String])
testE20 = ``sql Select s.Name From Result As r, Student As s
Where s.Key = r.StudentTakingKey And s.Age < 20
testE20 = ``sql Select s.Name From Result As r, Student As s
Where s.Key = r.StudentTakingKey And s.Age < 20
Group By s.Name Having Avg(s.Name) < 0.0;''
-- different types in case branches
testE21 :: IO( SQLResult [(String, String)])
testE21 = ``sql Select s.Name,
Case When s.Age < 20 Then "Young" Else 20 End
Case When s.Age < 20 Then "Young" Else 20 End
From Student as s;''
-- key- and null-value im Case
testE22 :: IO( SQLResult [(String, String)])
testE22 = ``sql Select s.Name,
Case When s.Age < 20 Then s.Key Else Null End
Case When s.Age < 20 Then s.Key Else Null End
From Student as s;''
-- null-value used in case
testE22' :: IO( SQLResult [(String, String)])
testE22' =``sql Select s.Name,
Case When s.Age < 20 Then 19 Else Null End
Case When s.Age < 20 Then 19 Else Null End
From Student as s;''
-- comparison of two embedded expressions
-- comparison of two embedded expressions
testE23 :: Int -> Int -> IO( SQLResult [(String, (Maybe Int))])
testE23 v1 v2 = ``sql Select s.Firstname, s.Age from Student as s Where {v1} < {v2};''
testE23 v1 v2 = ``sql Select s.Firstname, s.Age from Student as s Where {v1} < {v2};''
-- set value to null in update
testE24 :: IO( SQLResult () )
......@@ -207,45 +207,45 @@ testE26 = ``sql Update Student Set Email = 42 Where Not Age < 20;''
-- comparison of int-value to key
testE27 :: IO( SQLResult [String])
testE27 = ``sql Select s.Name From Result As r, Student As s
testE27 = ``sql Select s.Name From Result As r, Student As s
Where s.Key = 1 Group By s.Name Having r.Grade < 2.0;''
-- set int-Column to String value
testE28 :: IO( SQLResult ())
testE28 = ``sql Insert Into Student Values
testE28 = ``sql Insert Into Student Values
(8, "6828", "Julia", "Krone", "julia@mail.de", 26);''
-- null value for not nullable column
testE28' :: IO( SQLResult ())
testE28' = ``sql Insert Into Student Values
testE28' = ``sql Insert Into Student Values
(8, 6828, "Julia", "Krone", Null, 26);''
-- missing value for e-mail
testE28'' :: IO( SQLResult ())
testE28'' = ``sql Insert Into Student (Key, MatNum, Name, Firstname, Email) Values
testE28'' = ``sql Insert Into Student (Key, MatNum, Name, Firstname, Email) Values
(8, 6828, "Julia", "Krone", Null);''
-- two embedded expressions in case
-- two embedded expressions in case
testKeyfail1 :: IO( SQLResult [(StudentID,String)])
testKeyfail1 = ``sql Select s.Name,
Case When s.Age < 20 Then {(StudentID 2)} Else {(StudentID 3)} End
Case When s.Age < 20 Then {(StudentID 2)} Else {(StudentID 3)} End
From Student as s;''
-- key-value and int together
testKeyfail2 :: IO( SQLResult [(StudentID,String)])
testKeyfail2 = ``sql Select s.Name,
Case When s.Age < 20 Then 1 Else s.Key End
Case When s.Age < 20 Then 1 Else s.Key End
From Student as s;''
-- CDBI constraints
-- CDBI constraints
--more than three tables
testE29 :: IO( SQLResult [(Student, UniModel.Result, Exam, Time)])
testE29 =``sql Select * from Student, Result, Exam, Time;''
testE29 =``sql Select * from Student, Result, Exam, Time;''
-- more than five columns
testE30 :: IO( SQLResult [(Int,String,String, String, (Maybe Int), (Maybe Float))])
testE30 =``sql Select s.MatNum, s.Firstname, s.Name, s.Email, r.Points, r.Grade From Student as s, Result as r;''
testE30 =``sql Select s.MatNum, s.Firstname, s.Name, s.Email, r.Points, r.Grade From Student as s, Result as r;''
-- combination of * and set operation
testE31 :: IO( SQLResult [(String, String)]
......@@ -253,45 +253,45 @@ testE31 =``sql Select * from Lecture Union Select * from Lecturer;''
-- group by in exists
testE32 :: IO(SQLResult [Student])
testE32 =``sql Select Distinct * From Student As s
testE32 =``sql Select Distinct * From Student As s
Where Exists
( Select * From Participation As p
( Select * From Participation As p
Where s.Key = p.StudentParticipationKey Group By s.Name )
Limit 5;''
-- order by and limit in exists
-- order by and limit in exists
testE33 :: IO(SQLResult [Student])
testE33 =``sql Select Distinct * From Student As s
testE33 =``sql Select Distinct * From Student As s
Where Exists
( Select * From Participation As p
( Select * From Participation As p
Where s.Key = p.StudentParticipationKey Order By s.Name
Limit 5);''
-- more than one table in exists
-- more than one table in exists
testE34 :: IO(SQLResult [Student])
testE34 =``sql Select Distinct * From Student As s
testE34 =``sql Select Distinct * From Student As s
Where Exists
( Select * From Participation As p, Result as r)
Limit 5;''
-- order by in exists
Limit 5;''
-- order by in exists
testE35 :: IO(SQLResult [Student])
testE35 =``sql Select Distinct * From Student As s
testE35 =``sql Select Distinct * From Student As s
Where Exists
( Select * From Participation As p
( Select * From Participation As p
Where s.Key = p.StudentParticipationKey Order By s.Name )
Limit 5;''
-- limit in exists
testE36 :: IO(SQLResult [Student])
testE36 =``sql Select Distinct * From Student As s
testE36 =``sql Select Distinct * From Student As s
Where Exists
( Select * From Participation As p
( Select * From Participation As p
Where s.Key = p.StudentParticipationKey Limit 5);''
-- set op in exists
testE37 :: IO(SQLResult [Result])
testE37 = ``sql Select Distinct * From Result As r
testE37 = ``sql Select Distinct * From Result As r
Where Exists
( Select s.Name From Student as s
intersect
......@@ -300,8 +300,8 @@ testE37 = ``sql Select Distinct * From Result As r
-- key-value in case expression
testKeyfail :: IO( SQLResult [(StudentID,String)])
testKeyfail = ``sql Select s.Name,
Case When s.Age < 20 Then {(StudentID 2)} Else s.Key End
From Student as s;''
Case When s.Age < 20 Then {(StudentID 2)} Else s.Key End
From Student as s;''
--Tests to demonstrate error management
-- three times used : instead of .
......@@ -334,15 +334,15 @@ testE43 = ``sql Select st.Name from Students as st, Results as r;''
-- type error in case in condition and twice in having
testE44 :: IO(SQLResult [(String, String)])