Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fn_error_tests.cpp « tests « script « src - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8710efd79f85c05b2787f16245fc87ef5a3c757d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * \file   fn_error_tests.cpp
 * \brief  Automated test for the error() function.
 * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
 */

#include "premake.h"
#include "script_tests.h"

SUITE(script)
{
	TEST_FIXTURE(FxScript, Error_Exists_OnStartup)
	{
		const char* result = script_run_string(script, 
			"return (error ~= nil)");
		CHECK_EQUAL("true", result);
	}

	TEST_FIXTURE(FxScript, Error_SetsSessionError_OnCall)
	{
		script_run_string(script, 
			"error('an error message')");
		CHECK_EQUAL("[string \"error('an error message')\"]:1: an error message", error_get());
	}
}