Search in sources :

Example 1 with Proposition

use of il.org.spartan.utils.Proposition in project Main by SpartanRefactoring.

the class PropositionTest method aa.

@Test
public void aa() {
    object = Proposition.T;
    assert object != null;
    object = Proposition.F;
    assert object != null;
    object = Proposition.N;
    assert object != null;
    object = Proposition.X;
    assert Proposition.T != null;
    assert Proposition.T != null;
    assert Proposition.F != null;
    assert Proposition.T != null;
    assert Proposition.F != null;
    supplier = Proposition.T;
    assert supplier != null;
    supplier = Proposition.F;
    assert supplier != null;
    supplier = Proposition.T;
    assert supplier != null;
    supplier = Proposition.F;
    assert supplier != null;
    assert ignoreNext() || Proposition.T.getAsBoolean();
    assert ignoreNext() || Proposition.F.getAsBoolean();
    assert ignoreNext() || Proposition.T.getAsBoolean();
    assert ignoreNext() || Proposition.F.getAsBoolean();
    assert Proposition.T.getAsBoolean();
    assert !Proposition.F.getAsBoolean();
    assert Proposition.T.getAsBoolean();
    assert !Proposition.F.getAsBoolean();
    Proposition.that(Proposition.T);
    Proposition.that(Proposition.F);
    Proposition.that(Proposition.T);
    Proposition.that(Proposition.F);
    (Proposition.that(Proposition.T) + "").hashCode();
    (Proposition.that(Proposition.F) + "").hashCode();
    (Proposition.that(Proposition.T) + "").hashCode();
    (Proposition.that(Proposition.F) + "").hashCode();
    assert Proposition.that(Proposition.T) != null;
    assert Proposition.that(Proposition.F) != null;
    assert Proposition.that(Proposition.T) != null;
    assert Proposition.that(Proposition.F) != null;
    object = Proposition.that(Proposition.T);
    object = Proposition.that(Proposition.F);
    object = Proposition.that(Proposition.T);
    object = Proposition.that(Proposition.F);
    assert Proposition.that(Proposition.T) != null;
    assert Proposition.that(Proposition.F) != null;
    assert Proposition.that(Proposition.T) != null;
    assert Proposition.that(Proposition.F) != null;
    condition = Proposition.that(Proposition.T);
    condition = Proposition.that(Proposition.F);
    condition = Proposition.that(Proposition.T);
    condition = Proposition.that(Proposition.F);
    assert Proposition.that(() -> true).getAsBoolean();
    assert Proposition.that(() -> condition != null).getAsBoolean();
    assert !Proposition.that(() -> false).getAsBoolean();
    assert Proposition.that(() -> hashCode() == hashCode()).getAsBoolean();
    assert Proposition.that(Proposition.T).getAsBoolean();
    assert !Proposition.that(Proposition.F).getAsBoolean();
    assert Proposition.that(Proposition.T).getAsBoolean();
    assert !Proposition.that(Proposition.F).getAsBoolean();
    Proposition.AND(T, T);
    Proposition.AND(T, T);
    Proposition.AND(T, T, T);
    Proposition.AND(T, T, T, T);
    assert Proposition.AND(T, T).getAsBoolean();
    supplier = AND(T, T);
    condition = AND(T, T);
    inner = AND(T, T);
    assert Proposition.AND(T, T).getAsBoolean();
    assert !Proposition.AND(T, F).getAsBoolean();
    assert !Proposition.AND(F, T).getAsBoolean();
    assert !Proposition.AND(F, F).getAsBoolean();
    assert Proposition.AND(T, T, T).getAsBoolean();
    assert !Proposition.AND(T, F, T).getAsBoolean();
    assert !Proposition.AND(F, T, T).getAsBoolean();
    assert !Proposition.AND(F, F, T).getAsBoolean();
    assert Proposition.AND(T, T, T).getAsBoolean();
    assert !Proposition.AND(T, F, X).getAsBoolean();
    assert !Proposition.AND(F, X, X).getAsBoolean();
    assert !Proposition.AND(F, F, X).getAsBoolean();
    Proposition.OR(T, T);
    Proposition.OR(T, T);
    Proposition.OR(T, T, T);
    Proposition.OR(T, T, T, T);
    assert Proposition.OR(T, T).getAsBoolean();
    supplier = OR(T, T);
    condition = OR(T, T);
    inner = OR(T, T);
    assert Proposition.OR(T, T).getAsBoolean();
    assert Proposition.OR(T, F).getAsBoolean();
    assert Proposition.OR(F, T).getAsBoolean();
    assert !Proposition.OR(F, F).getAsBoolean();
    assert !Proposition.OR(F, F, F).getAsBoolean();
    assert Proposition.OR(F, F, T).getAsBoolean();
    assert Proposition.OR(F, T, F).getAsBoolean();
    assert Proposition.OR(F, T, T).getAsBoolean();
    assert Proposition.OR(T, F, F).getAsBoolean();
    assert Proposition.OR(T, F, T).getAsBoolean();
    assert Proposition.OR(T, T, F).getAsBoolean();
    assert Proposition.OR(T, T, T).getAsBoolean();
    assert Proposition.OR(F, T, X).getAsBoolean();
    assert Proposition.OR(T, X, X).getAsBoolean();
    assert T_OR_F_OR_X.getAsBoolean();
    assert Proposition.OR(T, X, X).getAsBoolean();
    assert Proposition.not(F).getAsBoolean();
    assert !Proposition.not(T).getAsBoolean();
    assert Proposition.not(F).and(not(F)).getAsBoolean();
    assert !Proposition.not(F).and(not(T)).getAsBoolean();
    assert Proposition.not(F).and(not(F)).or(T).getAsBoolean();
    assert Proposition.not(F).and(not(F)).or(T).eval();
    assert Proposition.not(F).and(not(F)).or(T).or(X).eval();
    assert Proposition.not(F).and(not(F)).or(T).or(X, X).eval();
    assert not(F).and(not(F)).getAsBoolean();
    assert !not(F).and(not(T)).getAsBoolean();
    assert not(F).and(not(F)).or(T).getAsBoolean();
    assert not(F).and(not(F)).or(T).eval();
    assert not(F).and(not(F)).or(T).or(X).eval();
    final Proposition or = not(F).and(not(F)).or(T).or(X, X);
    assert or.eval();
    assert Proposition.that(F).or(T).and(T).eval();
    assert OR(F, T).and(T).eval();
    assert OR(F, T).and(T).or(X).eval();
    assert !OR(F, T).and(T).and(F).eval();
}
Also used : Proposition(il.org.spartan.utils.Proposition) Test(org.junit.Test)

Aggregations

Proposition (il.org.spartan.utils.Proposition)1 Test (org.junit.Test)1