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

fn_language_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: a2791da76a1db315788bc843e6ceb24f930ab4f5 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
 * \file   fn_language_tests.cpp
 * \brief  Automated tests for the language() function.
 * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
 */

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


SUITE(script)
{
	TEST_FIXTURE(FxAccessor, Language_Exists_OnStartup)
	{
		const char* result = script_run_string(script, 
			"return (language ~= nil)");
		CHECK_EQUAL("true", result);
	}

	TEST_FIXTURE(FxAccessor, Guid_Error_OnNoActiveObject)
	{
		Script script = script_create();
		const char* result = script_run_string(script, "language()");
		CHECK_EQUAL("no active solution or project", result);
		script_destroy(script);
	}

	TEST_FIXTURE(FxAccessor, Language_CanRoundtrip)
	{
		const char* result = script_run_string(script,
			"language 'c++';"
			"return language()");
		CHECK_EQUAL("c++", result);
	}

	TEST_FIXTURE(FxAccessor, Language_RaisesError_OnInvalidLanguage)
	{
		const char* result = script_run_string(script,
			"language 'nosuch'");
		CHECK_EQUAL("invalid value 'nosuch'", result);
	}
}