init commit again
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving finalise-failing
|
||||
sequential (
|
||||
print map-delete({1 |-> 2},{}),
|
||||
print map-delete({1 |-> 2, 3 |-> 4},{}),
|
||||
print map-delete(map(),{1}),
|
||||
print map-delete({1 |-> 2},{1}),
|
||||
print map-delete({1 |-> 2, 3 |-> 4},{1}),
|
||||
print map-delete({1 |-> 2, 3 |-> 4},{3}),
|
||||
print map-delete({1 |-> 2, 3 |-> 4},{1,3}),
|
||||
print "OK"
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [
|
||||
{1 |-> 2},
|
||||
{1 |-> 2, 3 |-> 4},
|
||||
map(),
|
||||
map(),
|
||||
{3 |-> 4},
|
||||
{1 |-> 2},
|
||||
map(),
|
||||
"OK"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving finalise-failing
|
||||
sequential (
|
||||
print map-domain map(),
|
||||
print map-domain{1|->2},
|
||||
print map-domain{1|->2,3|->4},
|
||||
print map-domain{1|->2,3|->( )}
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null;
|
||||
standard-out: [{}, {1}, {1,3}, {1,3}];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving finalise-failing
|
||||
sequential (
|
||||
print map-elements map( ),
|
||||
print map-elements {1|->2},
|
||||
print map-elements {3|->4,5|->6}
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [tuple(1, 2), tuple(3, 4), tuple(5, 6) ];
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving finalise-failing
|
||||
sequential (
|
||||
print map-lookup({1|->2}, 1),
|
||||
print map-lookup({1|->2,3|->4}, 1),
|
||||
print map-lookup({1|->2,3|->4}, 3),
|
||||
else(
|
||||
effect checked map-lookup(map(), 1),
|
||||
effect checked map-lookup({1|->2}, 2),
|
||||
effect checked map-lookup({1|->2,3|->4}, 2),
|
||||
effect checked map-lookup({1|->2,3|->4}, 5),
|
||||
print "OK"
|
||||
)
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [2, 2, 4, "OK"];
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving finalise-failing
|
||||
sequential (
|
||||
print map-override({1 |-> 2},map()),
|
||||
print map-override(map(),{1 |-> 2}),
|
||||
print map-override({1 |-> 2},{1 |-> 2}),
|
||||
print map-override({1 |-> 2},{3 |-> 4}),
|
||||
print map-override({1 |-> 2},{1 |-> 4}),
|
||||
print map-override({1 |-> 2},{1 |-> 4},{1 |-> 2}),
|
||||
print map-override({1 |-> 2}),
|
||||
print map-override(map()),
|
||||
print map-override()
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [
|
||||
{1 |-> 2},
|
||||
{1 |-> 2},
|
||||
{1 |-> 2},
|
||||
{1 |-> 2, 3 |-> 4},
|
||||
{1 |-> 2},
|
||||
{1 |-> 2},
|
||||
{1 |-> 2},
|
||||
map(),
|
||||
map()
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving finalise-failing
|
||||
sequential (
|
||||
print map-unite({1 |-> 2},map()),
|
||||
print map-unite(map(),{1 |-> 2}),
|
||||
print map-unite({1 |-> 2},{3 |-> 4}),
|
||||
print map-unite({1 |-> 2}),
|
||||
print map-unite(map()),
|
||||
print map-unite(),
|
||||
else(
|
||||
effect checked map-unite({1 |-> 2},{1 |-> 4}),
|
||||
effect checked map-unite({1 |-> 2, 3 |-> 4},{5 |-> 6, 1 |-> 7}),
|
||||
print "OK"
|
||||
)
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [
|
||||
{1 |-> 2},
|
||||
{1 |-> 2},
|
||||
{1 |-> 2, 3 |-> 4},
|
||||
{1 |-> 2},
|
||||
map(),
|
||||
map(),
|
||||
"OK"
|
||||
];
|
||||
}
|
||||
23
IBAF-cbs/Funcons-beta/Values/Composite/Maps/tests/map.config
Normal file
23
IBAF-cbs/Funcons-beta/Values/Composite/Maps/tests/map.config
Normal file
@@ -0,0 +1,23 @@
|
||||
general {
|
||||
funcon-term:
|
||||
initialise-giving finalise-failing
|
||||
sequential (
|
||||
print map(),
|
||||
print {1 |-> 2},
|
||||
print {1 |-> 2, 3 |-> 4},
|
||||
print {1 |-> 2, 3 |-> ()},
|
||||
print cast({1 |-> 2}, maps(integers,integers))
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
tests {
|
||||
result-term: null-value;
|
||||
standard-out: [
|
||||
map(),
|
||||
{1 |-> 2},
|
||||
{1 |-> 2, 3 |-> 4},
|
||||
{1 |-> 2, 3 |-> ()},
|
||||
{1 |-> 2}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user