fixes
This commit is contained in:
parent
a2fa97383c
commit
4e99493aa5
BIN
Lab4/Lab4.pdf
BIN
Lab4/Lab4.pdf
Binary file not shown.
@ -28,8 +28,5 @@ class Test1 {
|
||||
"string",
|
||||
baos,
|
||||
old);
|
||||
|
||||
we.showStat();
|
||||
we.print();
|
||||
}
|
||||
}
|
@ -38,8 +38,5 @@ class Test2 {
|
||||
"",
|
||||
baos,
|
||||
old);
|
||||
|
||||
we.showStat();
|
||||
we.print();
|
||||
}
|
||||
}
|
@ -13,18 +13,6 @@ class Test3 {
|
||||
}
|
||||
}
|
||||
|
||||
we.prefix("jshell> class Incr implements Immutator<Integer,Integer> {");
|
||||
we.prefix(" ...> public Integer invoke(Integer t1) {");
|
||||
we.prefix(" ...> return t1 + 1;");
|
||||
we.prefix(" ...> }");
|
||||
we.prefix(" ...> }");
|
||||
|
||||
we.prefix("jshell> class Length implements Immutator<Integer,String> {");
|
||||
we.prefix(" ...> public Integer invoke(String t1) {");
|
||||
we.prefix(" ...> return t1.length();");
|
||||
we.prefix(" ...> }");
|
||||
we.prefix(" ...> }");
|
||||
|
||||
we.expect("new Incr().invoke(4)",
|
||||
new Incr().invoke(4).toString(),
|
||||
"5");
|
||||
@ -50,8 +38,5 @@ class Test3 {
|
||||
we.expect("new Improbable<>().invoke(new Improbable<>().invoke(1))",
|
||||
new Improbable<>().invoke(new Improbable<Integer>().invoke(1)).toString(),
|
||||
"<<1>>");
|
||||
|
||||
we.showStat();
|
||||
we.print();
|
||||
}
|
||||
}
|
@ -13,18 +13,6 @@ class Test4 {
|
||||
}
|
||||
}
|
||||
|
||||
we.prefix("jshell> class Incr implements Immutator<Integer,Integer> {");
|
||||
we.prefix(" ...> public Integer invoke(Integer t1) {");
|
||||
we.prefix(" ...> return t1 + 1;");
|
||||
we.prefix(" ...> }");
|
||||
we.prefix(" ...> }");
|
||||
|
||||
we.prefix("jshell> class Length implements Immutator<Integer,String> {");
|
||||
we.prefix(" ...> public Integer invoke(String t1) {");
|
||||
we.prefix(" ...> return t1.length();");
|
||||
we.prefix(" ...> }");
|
||||
we.prefix(" ...> }");
|
||||
|
||||
we.expect("Probably.just(4).transform(new Incr())",
|
||||
Probably.just(4).transform(new Incr()).toString(),
|
||||
"<5>");
|
||||
@ -47,8 +35,5 @@ class Test4 {
|
||||
we.expect("Probably.<String>just(null).transform(new Length()).transform(new Incr())",
|
||||
Probably.<String>just(null).transform(new Length()).transform(new Incr()).toString(),
|
||||
"<>");
|
||||
|
||||
we.showStat();
|
||||
we.print();
|
||||
}
|
||||
}
|
@ -13,18 +13,6 @@ class Test5 {
|
||||
}
|
||||
}
|
||||
|
||||
we.prefix("jshell> class Incr implements Immutator<Integer,Integer> {");
|
||||
we.prefix(" ...> public Integer invoke(Integer t1) {");
|
||||
we.prefix(" ...> return t1 + 1;");
|
||||
we.prefix(" ...> }");
|
||||
we.prefix(" ...> }");
|
||||
|
||||
we.prefix("jshell> class Length implements Immutator<Integer,String> {");
|
||||
we.prefix(" ...> public Integer invoke(String t1) {");
|
||||
we.prefix(" ...> return t1.length();");
|
||||
we.prefix(" ...> }");
|
||||
we.prefix(" ...> }");
|
||||
|
||||
we.expect("Probably.just(17).check(new IsModEq(3,2)) // 17 % 3 is equal to 2",
|
||||
Probably.just(17).check(new IsModEq(3,2)).toString(),
|
||||
"<17>");
|
||||
@ -41,8 +29,5 @@ class Test5 {
|
||||
we.expect("Probably.<Integer>just(null).check(new IsModEq(0,2))",
|
||||
Probably.<Integer>just(null).check(new IsModEq(0,2)).toString(),
|
||||
"<>");
|
||||
|
||||
we.showStat();
|
||||
we.print();
|
||||
}
|
||||
}
|
@ -18,21 +18,6 @@ class Test6 {
|
||||
Probably<Immutator<Integer,Integer>> noIncr = Probably.none();
|
||||
Probably<Immutator<Integer,String>> noLength = Probably.none();
|
||||
|
||||
we.prefix("jshell> class Incr implements Immutator<Integer,Integer> {");
|
||||
we.prefix(" ...> public Integer invoke(Integer t1) {");
|
||||
we.prefix(" ...> return t1 + 1;");
|
||||
we.prefix(" ...> }");
|
||||
|
||||
we.prefix("jshell> class Length implements Immutator<Integer,String> {");
|
||||
we.prefix(" ...> public Integer invoke(String t1) {");
|
||||
we.prefix(" ...> return t1.length();");
|
||||
we.prefix(" ...> }");
|
||||
|
||||
we.prefix("jshell> Probably<Immutator<Integer,Integer>> justIncr = Probably.just(new Incr());");
|
||||
we.prefix("jshell> Probably<Immutator<Integer,String>> justLength = Probably.just(new Length());");
|
||||
we.prefix("jshell> Probably<Immutator<Integer,Integer>> noIncr = Probably.none();");
|
||||
we.prefix("jshell> Probably<Immutator<Integer,String>> noLength = Probably.none();");
|
||||
|
||||
we.expect("Probably.just(17).<Integer>apply(justIncr)",
|
||||
Probably.just(17).apply(justIncr).toString(),
|
||||
"<18>");
|
||||
@ -58,8 +43,5 @@ class Test6 {
|
||||
we.expect("Probably.<String>none().<Integer>apply(noLength)",
|
||||
Probably.<String>none().apply(noLength).toString(),
|
||||
"<>");
|
||||
|
||||
we.showStat();
|
||||
we.print();
|
||||
}
|
||||
}
|
@ -54,8 +54,5 @@ class TestProbably {
|
||||
we.expect("Probably.none() == Probably.just(null)",
|
||||
Probably.none() == Probably.just(null),
|
||||
true);
|
||||
|
||||
// we.showStat();
|
||||
// we.print();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user