Files
mercury/tests/invalid/errors.m
Zoltan Somogyi fdd141bf77 Clean up the tests in the other test directories.
tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the tests
    that check compiler error messages, expect the new line numbers.

browser/cterm.m:
browser/tree234_cc.m:
    Import only one module per line.

tests/hard_coded/boyer.m:
    Fix something I missed.
2015-02-16 12:32:18 +11:00

105 lines
2.9 KiB
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% This file contains a bunch of test cases, all of which should result
% in errors of one kind or another.
%%% Module should start with :- module declaration.
%---------------------------------------------------------------------------%
:- pred pred_with_no_clauses_or_mode_declaration(int).
%---------------------------------------------------------------------------%
:- pred pred_with_no_clauses(int).
:- mode pred_with_no_clauses(input).
%---------------------------------------------------------------------------%
/*
:- pred pred_with_invalid_goal.
pred_with_invalid_goal :-
5.
*/
%---------------------------------------------------------------------------%
:- mode mode_declaration_without_pred_declaration.
%---------------------------------------------------------------------------%
:- mode missing_pred_declaration.
missing_pred_declaration.
%---------------------------------------------------------------------------%
clause_without_pred_or_mode_declaration.
%---------------------------------------------------------------------------%
:- pred pred_which_calls_non_existant_pred.
pred_which_calls_non_existant_pred :-
non_existant_pred.
%---------------------------------------------------------------------------%
:- type type_with_multiply_defined_ctors ---> a; a; f(int); f(int).
:- type du_type_which_references_undefined_type ---> f(undefined_type).
:- type eqv_type_which_references_undefined_type == undefined_type.
:- type circular_eqv_type == circular_eqv_type.
:- type indirectly_circular_eqv_type_1 == indirectly_circular_eqv_type_2.
:- type indirectly_circular_eqv_type_2 == indirectly_circular_eqv_type_1.
:- type non_transparent_du_type ---> f(T).
:- type non_transparent_eqv_type == f(T).
%---------------------------------------------------------------------------%
:- pred pred_which_binds_type_param(TypeParam::input).
pred_which_binds_type_param(Argument) :-
Argument = 0.
%---------------------------------------------------------------------------%
:- pred pred_with_unresolved_polymorphism.
pred_with_unresolved_polymorphism :-
pred_which_binds_type_param(Arg).
%---------------------------------------------------------------------------%
:- pred pred_producing_string(string).
:- pred pred_expecting_int(int).
:- pred pred_with_type_error.
pred_with_type_error :-
pred_producing_string(X),
pred_expecting_int(X).
:- pred pred_with_singleton_vars(T).
pred_with_singleton_vars(X).
%---------------------------------------------------------------------------%
:- import_module int.
:- use_module int.
:- use_module io.
:- type needs_qualification == state.
:- type has_qualification == io__state.
%---------------------------------------------------------------------------%