1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    2% Tests for predicates which check the type of a term
    3
    4%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    5
    6
    7%
    8% List of test suites
    9%
   10
   11test_suites([test_var, test_atom, test_integer, test_floattype,
   12             test_atomic, test_compound, test_nonvar, test_number]).
   13
   14
   15%
   16% var/1 test
   17% - ISO -
   18%
   19
   20test_var_1 :- var(foo).
   21test_var_2(Foo) :- var(Foo).
   22test_var_3(Foo) :- foo = Foo, var(Foo).
   23test_var_4 :- var(_).
   24
   25
   26%
   27% atom/1 test
   28% - ISO -
   29%
   30
   31test_atom_1 :- atom(atom).
   32test_atom_2 :- atom('string').
   33test_atom_3 :- atom(a(b)).
   34test_atom_4(Var) :- atom(Var).
   35test_atom_5 :- atom([]).
   36test_atom_6 :- atom(6).
   37test_atom_7 :- atom(3.3).
   38
   39
   40%
   41% integer/1 test
   42% - ISO -
   43%
   44
   45test_integer_1 :- integer(3).
   46test_integer_2 :- integer(-3).
   47test_integer_3 :- integer(3.3).
   48test_integer_4(X) :- integer(X).
   49test_integer_5 :- integer(atom).
   50
   51
   52%
   53% float/1 test (called real/1 in 2nd draft of ISO Prolog Standard)
   54% - ISO -
   55%
   56
   57test_floattype_1 :- float(3.3).
   58test_floattype_2 :- float(-3.3).
   59test_floattype_3 :- float(3).
   60test_floattype_4 :- float(atom).
   61test_floattype_5(X) :- float(X).
   62
   63
   64%
   65% atomic/1 test
   66% - ISO -
   67%
   68
   69test_atomic_1 :- atomic(atom).
   70test_atomic_2 :- atomic(a(b)).
   71test_atomic_3(Var) :- atomic(Var).
   72test_atomic_4 :- atomic(6).
   73test_atomic_5 :- atomic(3.3).
   74
   75
   76%
   77% compound/1 test
   78% - ISO -
   79%
   80
   81test_compound_1 :- compound(33.3).
   82test_compound_2 :- compound(-33.3).
   83test_compound_3 :- compound(-a).
   84test_compound_4 :- compound(_).
   85test_compound_5 :- compound(a).
   86test_compound_6 :- compound(a(b)).
   87test_compound_7 :- compound([a]).
   88
   89
   90%
   91% nonvar/1 test
   92% - ISO -
   93%
   94
   95test_nonvar_1 :- nonvar(33.3).
   96test_nonvar_2 :- nonvar(foo).
   97test_nonvar_3(Foo) :- nonvar(Foo).
   98test_nonvar_4(Foo) :- foo = Foo, nonvar(Foo).
   99test_nonvar_5 :- nonvar(_).
  100test_nonvar_6 :- nonvar(a(b)).
  101
  102
  103%
  104% number/1 test
  105% - ISO -
  106%
  107
  108test_number_1 :- number(3).
  109test_number_2 :- number(3.3).
  110test_number_3 :- number(-3).
  111test_number_4 :- number(a).
  112test_number_5(X) :- number(X)