Haskell Implementation of Unit testing a basic calculator
- Clone repository with
git clone https://github.com/alexandersep/CSU33012-SWENG-ASS1.git
- Enter CSU33012-SWENG-ASS1/ with
cd CSU33012-SWENG-ASS1/
- Initialise the stack with
stack init
- Compile test folder with
stack test
- Give yourself executable permissions for the
run.sh
script withchmod +x run.sh
- Run Haskell programme with
./run.sh
.
- Inputs include brackets, negative operands, operands, operators "+-/*^" and unary operators "+-"
./run.sh
Haskell Infix Calculator, Note: Input without Quotes e.g. 2 + 3 instead of "2 + 3"
Please input an infix expression: -3 *-2 / 5 + 1 - ((1 - 0) - ( -1 --2))*4
The answer is: Just 2.2
./run.sh
Haskell Infix Calculator, Note: Input without Quotes e.g. 2 + 3 instead of "2 + 3"
Please input an infix expression: --- -+ + - + -- 3 *+-+-2 / -- 5 + 1 - ( (- 1 - 0) - ( -1 --2) )* 4
The answer is: Just 7.8
./run.sh
Haskell Infix Calculator, Note: Input without Quotes e.g. 2 + 3 instead of "2 + 3"
Please input an infix expression: 3 * (-3 * 3) + 0 + 0 - 1 - 1 - 1 + ( +0 + 0) *--4
The answer is: Just (-30.0)
- The report of contributors and who contributed what can be found
in the file
Contribution.md
as text orContribution.pdf
as a pdf.
Alexander Sepelenco, sepelena@tcd.ie
Niall Sauvage, sauvagen@tcd.ie