mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 22:31:36 +00:00
functions-as-parameters testcase
This commit is contained in:
parent
70f9be0f59
commit
9cf696e0fa
3 changed files with 21 additions and 1 deletions
|
@ -16,7 +16,8 @@ TESTLIST = \
|
||||||
invalid-types \
|
invalid-types \
|
||||||
ngraphs \
|
ngraphs \
|
||||||
invalid-assign \
|
invalid-assign \
|
||||||
field-parameters
|
field-parameters \
|
||||||
|
functions-as-parameters
|
||||||
|
|
||||||
.PHONY: clean test
|
.PHONY: clean test
|
||||||
|
|
||||||
|
@ -162,6 +163,11 @@ field-parameters:
|
||||||
@$(VM) $< > $@/output
|
@$(VM) $< > $@/output
|
||||||
@diff $@/output $@/expected
|
@diff $@/output $@/expected
|
||||||
|
|
||||||
|
$(eval $(call maketest,functions-as-parameters,qcc))
|
||||||
|
functions-as-parameters:
|
||||||
|
@$(VM) $< > $@/output
|
||||||
|
@diff $@/output $@/expected
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
obj:
|
obj:
|
||||||
mkdir obj
|
mkdir obj
|
||||||
|
|
1
testsuite/functions-as-parameters/expected
Normal file
1
testsuite/functions-as-parameters/expected
Normal file
|
@ -0,0 +1 @@
|
||||||
|
correct
|
13
testsuite/functions-as-parameters/main.qc
Normal file
13
testsuite/functions-as-parameters/main.qc
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
void(string, string) print = #1;
|
||||||
|
|
||||||
|
string() getter = {
|
||||||
|
return "correct";
|
||||||
|
};
|
||||||
|
|
||||||
|
void(string() f) printer = {
|
||||||
|
print(f(), "\n");
|
||||||
|
};
|
||||||
|
|
||||||
|
void() main = {
|
||||||
|
printer(getter);
|
||||||
|
};
|
Loading…
Reference in a new issue