Skip to content

Commit 12aea0a

Browse files
committed
test only in answer directory
1 parent 2cf25c8 commit 12aea0a

37 files changed

+107
-12
lines changed

test/Test.hs

+14-12
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ module Main where
33
import Control.Applicative
44
import Control.Monad
55
import Data.IORef
6+
import Data.List
67

78
import Test.Framework (defaultMain)
89
import Test.Framework.Providers.HUnit (hUnitTestToTests)
910
import Test.HUnit
1011
import System.FilePath.Glob (glob)
11-
import System.FilePath (takeDirectory, replaceDirectory)
12+
import System.FilePath (takeDirectory, replaceDirectory, splitPath)
1213

1314
import Language.Egison.Types
1415
import Language.Egison.Core
@@ -18,23 +19,23 @@ import Language.Egison
1819
import UnitTest
1920

2021
main = do
21-
unitTestCases <- glob "test/**/*.egi"
22-
defaultMain $ hUnitTestToTests $ test $ map runUnitTestCase unitTestCases
23-
sampleTestCases <- glob "sample/*.egi"
24-
defaultMain $ hUnitTestToTests $ test $ map runSampleTestCase sampleTestCases
22+
unitTestCases <- glob "test/[^answer]**/*.egi"
23+
sampleTestCases <- glob "test/answer/**/*.egi"
24+
defaultMain $ hUnitTestToTests $ test $ map runUnitTestCase unitTestCases ++ map runSampleTestCase sampleTestCases
2525

2626
runSampleTestCase :: FilePath -> Test
2727
runSampleTestCase file = TestLabel file . TestCase $ do
2828
env <- initialEnv
2929
let directory_path = takeDirectory file
30-
answers <- readFile (replaceDirectory file ("test/answer/" ++ directory_path))
30+
answers <- readFile file
3131
assertEgisonM (lines answers) $ do
32-
exprs <- loadFile file
32+
exprs <- loadFile (replaceDirectory file $ concat $ drop 2 $ splitPath directory_path)
3333
let (bindings, tests) = foldr collectDefsAndTests ([], []) exprs
3434
env' <- recursiveBind env bindings
35-
forM tests $ evalExprDeep env'
35+
vals <- forM tests (evalExprDeep env')
36+
return $ zip tests vals
3637
where
37-
assertEgisonM :: [String] -> EgisonM [EgisonValue] -> Assertion
38+
assertEgisonM :: [String] -> EgisonM [(EgisonExpr, EgisonValue)] -> Assertion
3839
assertEgisonM answers m = fromEgisonM m >>= assertString . either show (f answers)
3940

4041
collectDefsAndTests (Define name expr) (bindings, tests) =
@@ -43,9 +44,10 @@ runSampleTestCase file = TestLabel file . TestCase $ do
4344
(bindings, expr : tests)
4445
collectDefsAndTests _ r = r
4546

46-
f :: [String] -> [EgisonValue] -> String
47+
f :: [String] -> [(EgisonExpr, EgisonValue)] -> String
4748
f answers ls = g answers ls 0
48-
g x y i = if (x !! i) == show (y !! i)
49+
g x y i = let (e, v) = unzip y in
50+
if (x !! i) == show (v !! i)
4951
then (if i < (length y - 1) then g x y (i + 1)
5052
else "")
51-
else "failed " ++ show i ++ "\n expected: " ++ (x !! i) ++ "\n but found: " ++ show (y !! i)
53+
else "failed " ++ show (e !! i) ++ "\n expected: " ++ (x !! i) ++ "\n but found: " ++ show (v !! i)

test/answer/sample/binary-counter.egi

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{} {0} {1} {0 0} {0 1} {1 0} {0 0 0} {1 1} {0 0 1} {0 1 0} {1 0 0} {0 0 0 0} {0 1 1} {1 0 1} {1 1 0} {0 0 0 1} {0 0 1 0} {0 1 0 0} {1 0 0 0} {1 1 1} {0 0 0 0 0} {0 0 1 1} {0 1 0 1} {0 1 1 0} {1 0 0 1} {1 0 1 0} {1 1 0 0} {0 0 0 0 1} {0 0 0 1 0} {0 0 1 0 0}}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{"a" "a" "a" "a" "b" "c"}
2+
{2 6}
3+
{2 6}
4+
{1 2 4 5}
5+
{1 5}
6+
{1 3 4 5}

test/answer/sample/demo1-ja.egi

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{[3 5] [5 7] [11 13] [17 19] [29 31] [41 43] [59 61] [71 73] [101 103] [107 109]}

test/answer/sample/demo1.egi

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{[3 5] [5 7] [11 13] [17 19] [29 31] [41 43] [59 61] [71 73] [101 103] [107 109]}

test/answer/sample/graph.egi

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{4}
2+
{{|[1 1] [2 4] [3 3]|}}
3+
{{|[1 1] [2 4] [3 6] [4 2]|} {|[1 1] [2 4] [3 1] [4 4] [5 6] [6 2]|} {|[1 1] [2 4] [3 6] [4 2] [5 3] [6 2]|} {|[1 1] [2 5] [3 1] [4 4] [5 6] [6 2]|} {|[1 1] [2 5] [3 9] [4 3] [5 2]|}}
4+
{{|[1 1] [2 5] [3 8]|} {|[1 1] [2 8] [3 5]|} {|[1 2] [2 6] [3 12]|} {|[1 5] [2 1] [3 8]|} {|[1 3] [2 7] [3 9]|} {|[1 2] [2 12] [3 6]|} {|[1 3] [2 9] [3 7]|} {|[1 5] [2 8] [3 1]|} {|[1 6] [2 2] [3 12]|} {|[1 7] [2 3] [3 9]|} {|[1 8] [2 1] [3 5]|} {|[1 6] [2 12] [3 2]|} {|[1 8] [2 5] [3 1]|} {|[1 7] [2 9] [3 3]|} {|[1 6] [2 10] [3 12]|} {|[1 9] [2 3] [3 7]|} {|[1 6] [2 12] [3 10]|} {|[1 9] [2 7] [3 3]|} {|[1 12] [2 2] [3 6]|} {|[1 10] [2 6] [3 12]|} {|[1 12] [2 6] [3 2]|} {|[1 10] [2 12] [3 6]|} {|[1 12] [2 6] [3 10]|} {|[1 12] [2 10] [3 6]|}}

test/answer/sample/io/args.egi

Whitespace-only changes.

test/answer/sample/io/cat.egi

Whitespace-only changes.

test/answer/sample/io/cut.egi

Whitespace-only changes.

test/answer/sample/io/hello.egi

Whitespace-only changes.

test/answer/sample/io/print-primes.egi

Whitespace-only changes.

test/answer/sample/mahjong.egi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#t
2+
#f
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(+ (rtu 11) (rtu 11)^10 (* (rtu 5) (rtu 11)^2) (* (rtu 5) (rtu 11)^9) (* (rtu 5)^2 (rtu 11)^3) (* (rtu 5)^2 (rtu 11)^8) (* (rtu 5)^3 (rtu 11)^4) (* (rtu 5)^3 (rtu 11)^7) (* (rtu 5)^4 (rtu 11)^5) (* (rtu 5)^4 (rtu 11)^6))
2+
(+ (* 5 (rtu 11)^6) (* 2 (rtu 11)^7) (* (rtu 11)^2 (rtu 5)) (* 2 (rtu 5)) (* 3 (rtu 11)^3 (rtu 5)^2) (* 2 (rtu 11)^10 (rtu 5)^2) (* 3 (rtu 11)^4 (rtu 5)^3) (* 4 (rtu 11)^9 (rtu 5)^3) (* 4 (rtu 11)^5 (rtu 5)^4) (* 2 (rtu 11)^8 (rtu 5)^4) (rtu 11)^4 (rtu 11)^5 (* (rtu 11)^9 (rtu 5)) (* 2 (rtu 11) (rtu 5)^2) (* 5 (rtu 11)^8 (rtu 5)^2) (* 3 (rtu 11)^2 (rtu 5)^3) (* 3 (rtu 11)^7 (rtu 5)^3) (* 2 (rtu 11)^3 (rtu 5)^4) (* 4 (rtu 11)^6 (rtu 5)^4) (* 4 (rtu 5) (rtu 11)^7) (* 2 (rtu 5) (rtu 11)^8) (* 2 (rtu 5)^3) (* 3 (rtu 5)^4 (rtu 11)^10) (* 2 (rtu 11)^9) (* (rtu 11)^3 (rtu 5)) (* (rtu 11)^4 (rtu 5)) (* 3 (rtu 11) (rtu 5)^4) (* 2 (rtu 11)^13) (* 4 (rtu 11)^16) (* 2 (rtu 5)^2 (rtu 11)^9) (* 2 (rtu 11)^11) (* 2 (rtu 5) (rtu 11)^10) (* (rtu 11)^2 (rtu 5)^2) (* 2 (rtu 5) (rtu 11)^12) (* 3 (rtu 5) (rtu 11)^15) (* 2 (rtu 5)^3 (rtu 11)^10) (* 2 (rtu 5)^2 (rtu 11)^11) (* (rtu 11) (rtu 5)^3) (* 2 (rtu 5)^2 (rtu 11)^14) (* 2 (rtu 5)^4) (rtu 11)^15 (* (rtu 5) (rtu 11)^14) (* (rtu 5)^2 (rtu 11)^13) (* (rtu 5)^3 (rtu 11)^12) (* (rtu 5)^3 (rtu 11)^13))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(/ (+ -1 (sqrt 17) (* (sqrt 2) (sqrt (+ 17 (* -1 (sqrt 17))))) (* 2 (sqrt (+ 17 (* 3 (sqrt 17)) (* -1 (sqrt 2) (sqrt (+ 17 (* -1 (sqrt 17))))) (* -2 (sqrt 2) (sqrt (+ 17 (sqrt 17)))))))) 8)
2+
(/ (+ -1 (sqrt 17) (* (sqrt 2) (sqrt (+ 17 (* -1 (sqrt 17))))) (* 2 (sqrt (+ 17 (* 3 (sqrt 17)) (* -1 (sqrt 2) (sqrt (+ 17 (* -1 (sqrt 17))))) (* -2 (sqrt 2) (sqrt (+ 17 (sqrt 17)))))))) 8)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(/ (+ -1 (sqrt 5) (sqrt (+ -5 (* -2 (sqrt 5)))) (sqrt (+ -5 (* 2 (sqrt 5))))) 4)
2+
(+ -10 (* 2 (sqrt (+ -5 (* -2 (sqrt 5)))) (sqrt (+ -5 (* 2 (sqrt 5))))))
3+
5
4+
(/ (+ -1 (sqrt 5) (* (sqrt 2) (sqrt (+ -5 (* -1 (sqrt 5)))))) 4)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(/ (+ -1 (* (sqrt 7) i) (* (rt 3 7) (rt 3 (+ (* 3 w) 2))) (* -1 (rt 6 7) (rt 3 (+ 5 (* -3 w^2))) i) (rt 3 (+ (* 18 w^2) 11 (* -3 w))) (* -1 (rt 6 7) (rt 3 (+ 5 (* -3 w))) i)) 6)
2+
(/ (+ -1 (* (rt 3 7) (rt 3 (+ 2 (* 3 w)))) (* (rt 3 7) (rt 3 (+ -1 (* -3 w)))) (* (sqrt 7) i) (* -1 (rt 6 7) (rt 3 (+ 5 (* -3 w))) i) (* -1 (rt 6 7) (rt 3 (+ 5 (* -3 w^2))) i)) 6)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{[1 1 {}] [2 1 {}] [3 2 {2}] [4 2 {2}] [5 4 {2 2}] [6 2 {2}] [7 6 {2 3}] [8 4 {2 2}] [9 6 {2 3}] [10 4 {2 2}] [11 10 {2 5}] [12 4 {2 2}] [13 12 {2 2 3}] [14 6 {2 3}] [15 8 {2 2 2}] [16 8 {2 2 2}] [17 16 {2 2 2 2}] [18 6 {2 3}] [19 18 {2 3 3}] [20 8 {2 2 2}] [21 12 {2 2 3}] [22 10 {2 5}] [23 22 {2 11}] [24 8 {2 2 2}] [25 20 {2 2 5}] [26 12 {2 2 3}] [27 18 {2 3 3}] [28 12 {2 2 3}] [29 28 {2 2 7}] [30 8 {2 2 2}] [31 30 {2 3 5}] [32 16 {2 2 2 2}] [33 20 {2 2 5}] [34 16 {2 2 2 2}] [35 24 {2 2 2 3}] [36 12 {2 2 3}] [37 36 {2 2 3 3}] [38 18 {2 3 3}] [39 24 {2 2 2 3}] [40 16 {2 2 2 2}] [41 40 {2 2 2 5}] [42 12 {2 2 3}] [43 42 {2 3 7}] [44 20 {2 2 5}] [45 24 {2 2 2 3}] [46 22 {2 11}] [47 46 {2 23}] [48 16 {2 2 2 2}] [49 42 {2 3 7}] [50 20 {2 2 5}] [51 32 {2 2 2 2 2}] [52 24 {2 2 2 3}] [53 52 {2 2 13}] [54 18 {2 3 3}] [55 40 {2 2 2 5}] [56 24 {2 2 2 3}] [57 36 {2 2 3 3}] [58 28 {2 2 7}] [59 58 {2 29}] [60 16 {2 2 2 2}] [61 60 {2 2 3 5}] [62 30 {2 3 5}] [63 36 {2 2 3 3}] [64 32 {2 2 2 2 2}] [65 48 {2 2 2 2 3}] [66 20 {2 2 5}] [67 66 {2 3 11}] [68 32 {2 2 2 2 2}] [69 44 {2 2 11}] [70 24 {2 2 2 3}] [71 70 {2 5 7}] [72 24 {2 2 2 3}] [73 72 {2 2 2 3 3}] [74 36 {2 2 3 3}] [75 40 {2 2 2 5}] [76 36 {2 2 3 3}] [77 60 {2 2 3 5}] [78 24 {2 2 2 3}] [79 78 {2 3 13}] [80 32 {2 2 2 2 2}] [81 54 {2 3 3 3}] [82 40 {2 2 2 5}] [83 82 {2 41}] [84 24 {2 2 2 3}] [85 64 {2 2 2 2 2 2}] [86 42 {2 3 7}] [87 56 {2 2 2 7}] [88 40 {2 2 2 5}] [89 88 {2 2 2 11}] [90 24 {2 2 2 3}] [91 72 {2 2 2 3 3}] [92 44 {2 2 11}] [93 60 {2 2 3 5}] [94 46 {2 23}] [95 72 {2 2 2 3 3}] [96 32 {2 2 2 2 2}] [97 96 {2 2 2 2 2 3}] [98 42 {2 3 7}] [99 60 {2 2 3 5}] [100 40 {2 2 2 5}]}
2+
{[1 1 {}] [2 1 {}] [3 2 {2}] [4 2 {2}] [5 4 {2 2}] [6 2 {2}] [7 6 {2 3}] [8 4 {2 2}] [9 6 {2 3}] [10 4 {2 2}] [11 10 {2 5}] [12 4 {2 2}] [13 12 {2 2 3}] [14 6 {2 3}] [15 8 {2 2 2}] [16 8 {2 2 2}] [17 16 {2 2 2 2}] [18 6 {2 3}] [19 18 {2 3 3}] [20 8 {2 2 2}] [21 12 {2 2 3}] [22 10 {2 5}] [23 22 {2 11}] [24 8 {2 2 2}] [25 20 {2 2 5}] [26 12 {2 2 3}] [27 18 {2 3 3}] [28 12 {2 2 3}] [29 28 {2 2 7}] [30 8 {2 2 2}] [31 30 {2 3 5}] [32 16 {2 2 2 2}] [33 20 {2 2 5}] [34 16 {2 2 2 2}] [35 24 {2 2 2 3}] [36 12 {2 2 3}] [37 36 {2 2 3 3}] [38 18 {2 3 3}] [39 24 {2 2 2 3}] [40 16 {2 2 2 2}] [41 40 {2 2 2 5}] [42 12 {2 2 3}] [43 42 {2 3 7}] [44 20 {2 2 5}] [45 24 {2 2 2 3}] [46 22 {2 11}] [47 46 {2 23}] [48 16 {2 2 2 2}] [49 42 {2 3 7}] [50 20 {2 2 5}] [51 32 {2 2 2 2 2}] [52 24 {2 2 2 3}] [53 52 {2 2 13}] [54 18 {2 3 3}] [55 40 {2 2 2 5}] [56 24 {2 2 2 3}] [57 36 {2 2 3 3}] [58 28 {2 2 7}] [59 58 {2 29}] [60 16 {2 2 2 2}] [61 60 {2 2 3 5}] [62 30 {2 3 5}] [63 36 {2 2 3 3}] [64 32 {2 2 2 2 2}] [65 48 {2 2 2 2 3}] [66 20 {2 2 5}] [67 66 {2 3 11}] [68 32 {2 2 2 2 2}] [69 44 {2 2 11}] [70 24 {2 2 2 3}] [71 70 {2 5 7}] [72 24 {2 2 2 3}] [73 72 {2 2 2 3 3}] [74 36 {2 2 3 3}] [75 40 {2 2 2 5}] [76 36 {2 2 3 3}] [77 60 {2 2 3 5}] [78 24 {2 2 2 3}] [79 78 {2 3 13}] [80 32 {2 2 2 2 2}] [81 54 {2 3 3 3}] [82 40 {2 2 2 5}] [83 82 {2 41}] [84 24 {2 2 2 3}] [85 64 {2 2 2 2 2 2}] [86 42 {2 3 7}] [87 56 {2 2 2 7}] [88 40 {2 2 2 5}] [89 88 {2 2 2 11}] [90 24 {2 2 2 3}] [91 72 {2 2 2 3 3}] [92 44 {2 2 11}] [93 60 {2 2 3 5}] [94 46 {2 23}] [95 72 {2 2 2 3 3}] [96 32 {2 2 2 2 2}] [97 96 {2 2 2 2 2 3}] [98 42 {2 3 7}] [99 60 {2 2 3 5}] [100 40 {2 2 2 5}]}

test/answer/sample/math/number/fib.egi

Whitespace-only changes.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
1
2+
2
3+
(/ 5 2)
4+
(/ 8 3)
5+
(/ 65 24)
6+
(/ 163 60)
7+
(/ 1957 720)
8+
(/ 685 252)
9+
(/ 109601 40320)
10+
(/ 98641 36288)
11+
2.7182815255731922
12+
2.718281828459045
13+
2.718281828459045

test/answer/sample/math/number/pi.egi

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2
2+
(/ 7 2)
3+
(/ 46 15)
4+
(/ 464 147)
5+
(/ 2872 915)
6+
(/ 597 190)
7+
(/ 41672 13265)
8+
(/ 166144 52885)
9+
(/ 9305216 2961945)
10+
(/ 11567456 3682035)
11+
3.141592653589793
12+
3.141592653589793
13+
3.141592653589793
14+
π
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{[1 1 2] [1 2 9] [2 2 16] [1 3 28] [2 3 35] [3 3 54] [1 4 65] [2 4 72] [3 4 91] [4 4 128]}
2+
{[[9 10 1729] [1 12 1729]] [[9 15 4104] [2 16 4104]]}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(/ (+ (* a z) b) (+ (* c z) d))

test/answer/sample/mickey.egi

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"10,000,000,000"
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{2 3 3 2}
2+
{1 4 5 6}
3+
{1 1 13}
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{[1 1] [1 2] [2 1] [1 3] [2 2] [3 1] [1 4] [2 3] [3 2] [4 1] [1 5] [2 4] [3 3] [4 2] [5 1] [1 6] [2 5] [3 4] [4 3] [5 2] [6 1] [1 7] [2 6] [3 5] [4 4] [5 3] [6 2] [7 1] [1 8] [2 7] [3 6] [4 5] [5 4] [6 3] [7 2] [8 1] [1 9] [2 8] [3 7] [4 6] [5 5] [6 4] [7 3] [8 2] [9 1] [1 10] [2 9] [3 8] [4 7] [5 6] [6 5] [7 4] [8 3] [9 2] [10 1] [1 11] [2 10] [3 9] [4 8] [5 7] [6 6] [7 5] [8 4] [9 3] [10 2] [11 1] [1 12] [2 11] [3 10] [4 9] [5 8] [6 7] [7 6] [8 5] [9 4] [10 3] [11 2] [12 1] [1 13] [2 12] [3 11] [4 10] [5 9] [6 8] [7 7] [8 6] [9 5] [10 4] [11 3] [12 2] [13 1] [1 14] [2 13] [3 12] [4 11] [5 10] [6 9] [7 8] [8 7] [9 6]}
2+
{[3 5] [5 7] [11 13] [17 19] [29 31] [41 43] [59 61] [71 73] [101 103] [107 109] [137 139] [149 151] [179 181] [191 193] [197 199] [227 229] [239 241] [269 271] [281 283] [311 313] [347 349] [419 421] [431 433] [461 463] [521 523] [569 571] [599 601] [617 619] [641 643] [659 661] [809 811] [821 823] [827 829] [857 859] [881 883] [1019 1021] [1031 1033] [1049 1051] [1061 1063] [1091 1093] [1151 1153] [1229 1231] [1277 1279] [1289 1291] [1301 1303] [1319 1321] [1427 1429] [1451 1453] [1481 1483] [1487 1489] [1607 1609] [1619 1621] [1667 1669] [1697 1699] [1721 1723] [1787 1789] [1871 1873] [1877 1879] [1931 1933] [1949 1951] [1997 1999] [2027 2029] [2081 2083] [2087 2089] [2111 2113] [2129 2131] [2141 2143] [2237 2239] [2267 2269] [2309 2311] [2339 2341] [2381 2383] [2549 2551] [2591 2593] [2657 2659] [2687 2689] [2711 2713] [2729 2731] [2789 2791] [2801 2803] [2969 2971] [2999 3001] [3119 3121] [3167 3169] [3251 3253] [3257 3259] [3299 3301] [3329 3331] [3359 3361] [3371 3373] [3389 3391] [3461 3463] [3467 3469] [3527 3529] [3539 3541] [3557 3559] [3581 3583] [3671 3673] [3767 3769] [3821 3823]}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(+ α β γ)
2+
(+ (* α β) (* α γ) (* β γ))
3+
(* α β γ)
4+
[| [| 1 0 0 |] [| 0 1 0 |] [| 0 0 1 |] |]_i_j
5+
[| [| (+ β γ) 0 0 |] [| 0 (+ α γ) 0 |] [| 0 0 (+ α β) |] |]_i_j
6+
[| [| (* β γ) 0 0 |] [| 0 (* α γ) 0 |] [| 0 0 (* α β) |] |]_i_j
7+
(+ (* c1 α) (* c1 β) (* c1 γ) (* -3 c1) (* c2 α β) (* c2 α γ) (* c2 β γ) (* -3 c2))
8+
[| [| (/ (+ (* 2 c1 α) (* 2 c2 β α) (* 2 c2 γ α) (* -1 p)) α) 0 0 |] [| 0 (/ (+ (* 2 c1 β) (* 2 c2 α β) (* 2 c2 γ β) (* -1 p)) β) 0 |] [| 0 0 (/ (+ (* 2 c1 γ) (* 2 c2 α γ) (* 2 c2 β γ) (* -1 p)) γ) |] |]_#_#
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[| [| (* -1 p) 0 0 |] [| 0 (* -1 p) 0 |] [| 0 0 (* -1 p) |] |]_#_#
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[| [| (/ (+ (* 4 c1 l^2) (* -4 c1 (sqrt l)) (* 4 c2 l (sqrt l)) (* -4 c2) (* -3 p l)) (* 3 l^2)) 0 0 |] [| 0 (/ (+ (* -2 c1 l^2 (sqrt l)) (* 2 c1 l) (* -2 c2 l^2) (* 2 c2 (sqrt l)) (* -3 p l (sqrt l))) (* 3 l)) 0 |] [| 0 0 (/ (+ (* -2 c1 l^2 (sqrt l)) (* 2 c1 l) (* -2 c2 l^2) (* 2 c2 (sqrt l)) (* -3 p l (sqrt l))) (* 3 l)) |] |]_#_#
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<Straight-Flush>
2+
<Full-House>
3+
<Straight>
4+
<One-Pair>

test/answer/sample/poker-hands.egi

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<Straight-Flush>
2+
<Full-House>
3+
<Straight>
4+
<Nothing>

test/answer/sample/primes.egi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{[3 5] [5 7] [11 13] [17 19] [29 31] [41 43] [59 61] [71 73] [101 103] [107 109]}
2+
{[5 7 11] [7 11 13] [11 13 17] [13 17 19] [17 19 23] [37 41 43] [41 43 47] [67 71 73] [97 101 103] [101 103 107]}

test/answer/sample/repl/egison.egi

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{'B' 'D' 'C' 'A'} {'H' 'I' 'K' 'F' 'G'}}

test/answer/sample/rosetta/lcs.egi

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{0 2 4 6}
2+
{0 1 4 9}
3+
{4 8 12 16}
4+
{4 16 36 64}

test/answer/sample/tail-recursion.egi

Whitespace-only changes.

test/answer/sample/tree.egi

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"Egison" "Prolog" "LiLFeS" "C++" "Curry" "Java" "Ruby" "Python" "OCaml" "Haskell" "Lisp" "Coq" "Scheme" "Clojure"}
2+
{"OCaml" "Haskell" "Egison" "Curry" "Lisp" "Coq" "Scheme" "Clojure"}
3+
{"Egison" "OCaml" "Curry"}
4+
{{|[1 "Programming language"] [2 "Pattern-matching oriented"]|} {|[1 "Programming language"] [2 "Functional language"] [3 "Dynamically typed"]|}}

0 commit comments

Comments
 (0)