Skip to content

Commit

Permalink
tests: Add testcase for 'with KerCat(%)' vs. 'Ker %'
Browse files Browse the repository at this point in the history
  • Loading branch information
pbroadbery committed Jun 25, 2024
1 parent 8991435 commit 5595ebf
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
8 changes: 7 additions & 1 deletion aldor/aldor/test/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ foamdir = $(abs_top_builddir)/aldor/lib/libfoam
aptests := exquo
fmtests := rectest enumtest clos strtable1 simple apply \
nestcond silly cexp lself0 selfcond lself \
lself2 catdef2
lself2 catdef2 args1a args1 args2a args2
ctests := rectest enumtest multinever maptuple cimp1
otests := enumtest
xtests := enumtest jimport cross seq small

out/ao/lself.ao: out/ao/lself0.ao
out/ao/lself2.ao: out/ao/lself0.ao
out/ao/args1.ao: out/ao/args1a.ao
out/ao/args2.ao: out/ao/args2a.ao

@BUILD_JAVA_TRUE@jtests := simple_j enumtest run_j halt
@HAS_JUNIT_TRUE@junittests := JExportTest JThrowTest
Expand All @@ -74,6 +76,8 @@ halt_opts := -Q3
jlist_opts :=
lself_opts = -Y out/ao
lself2_opts = -Y out/ao
args1_opts = -Y out/ao
args2_opts = -Y out/ao

jexport_extjava := aldor.stuff.Foo aldor.stuff.Bar
jthrow_extjava := aldor.stuff.ExnThrow
Expand All @@ -97,6 +101,8 @@ strtable1_AXLFLAGS=-Y$(foamdir)/al -I $(foamsrcdir)/al -lRuntimeLib=foam -Q9
clos_AXLFLAGS := -Q2
simple_AXLFLAGS=-O
multinever_AXLFLAGS = -Q9
args1_AXLFLAGS =
args2_AXLFLAGS =

_aptests := $(sort $(aptests))
_ctests := $(sort $(ctests) $(otests))
Expand Down
12 changes: 12 additions & 0 deletions aldor/aldor/test/args1.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "foamlib"
#pile
#library A1 "args1a.ao"
import from A1

ExprSpace: Category == with ExprSpace2P(Ker %)

--ExprSpaceO: Category == with ExprSpace2P KerP


--f(K1: KerCat %): Integer == never

13 changes: 13 additions & 0 deletions aldor/aldor/test/args1a.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "foamlib"
#pile

KerCat(S: with): Category == with
KerCat1(S1: with): Category == with KerCat S1

Ker(T: with): KerCat1 T == add

KerP: KerCat % with == Ker % add

-- ExpressionSpace2(K : KernelCategory(%)) : Category == with
ExprSpace2K(K: with KerCat(K)): Category == with
ExprSpace2P(K: with KerCat(%)): Category == with
9 changes: 9 additions & 0 deletions aldor/aldor/test/args2.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "foamlib"
#pile
#library A1 "args2a.ao"
import from A1

ExprSpace: Category == with
ExprSpace2(Ker %)
Compble

19 changes: 19 additions & 0 deletions aldor/aldor/test/args2a.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "foamlib"
#pile

Compble: Category == with
>: (%, %) -> Boolean
OSet(A: with): Category == with
contains?: (%, A) -> Boolean

-- KernelCategory(S : Comparable) : Category == Join(OrderedSet, Patternable S)
KerCat(S: Compble): Category == with
OSet S

Ker(S: Compble): KerCat S with Compble == add
contains?(a: %, s: S): Boolean == never
(>)(a: %, b: %): Boolean == never

-- ExpressionSpace2(K : KernelCategory(%)) : Category == with Comparable
KC ==> with Join(KerCat %, Compble)
ExprSpace2(K: KC): Category == with Compble

0 comments on commit 5595ebf

Please sign in to comment.