Skip to content

Commit

Permalink
Remove unused T annotation from Suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
q-uint committed Mar 19, 2022
1 parent 9917740 commit d4ea0bb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Suite.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@ import { debugPrint } = "mo:⛔";
import Testify "Testify";

module {
public type Test<T> = (
public type Test = (
print : (t : Text) -> ()
) -> Bool;

public func equal<T, E>(
public func equal<E>(
testify : Testify.TestifyElement<E>,
actual : E
) : Test<T> = func (print: (t : Text) -> ()) : Bool {
) : Test = func (print: (t : Text) -> ()) : Bool {
let b = testify.equal(testify.element, actual);
if (not b) print("💬 expected: " # testify.toText(testify.element) # ", actual: " # testify.toText(actual));
b;
};

public type NamedTest<T> = {
#Describe : (Text, [NamedTest<T>]);
#Test : (Text, Test<T>);
public type NamedTest = {
#Describe : (Text, [NamedTest]);
#Test : (Text, Test);
};

public func describe<T>(name : Text, tests : [NamedTest<T>]) : NamedTest<T> {
public func describe(name : Text, tests : [NamedTest]) : NamedTest {
#Describe(name, tests);
};

public func it<T>(name : Text, test : () -> Bool) : NamedTest<T> {
public func it(name : Text, test : () -> Bool) : NamedTest {
#Test(name, func (print : (t : Text) -> ()) : Bool = test());
};

public func itp<T>(name : Text, test : Test<T>) : NamedTest<T> {
public func itp(name : Text, test : Test) : NamedTest {
#Test(name, test);
};

Expand All @@ -47,7 +47,7 @@ module {
};
};

public class Suite<T>(state : T) {
public class Suite() {
let s : Status = Status();

var indent = 0;
Expand All @@ -57,13 +57,13 @@ module {
debugPrint(s # t);
};

public func run(tests : [NamedTest<T>]) {
public func run(tests : [NamedTest]) {
_run(tests);
debugPrint("");
s.printStatus();
};

private func _run(tests : [NamedTest<T>]) {
private func _run(tests : [NamedTest]) {
for (k in tests.keys()) {
let t = tests[k];
switch (t) {
Expand Down

0 comments on commit d4ea0bb

Please sign in to comment.