mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-03 20:02:28 +01:00
#1213 added very basic test file for D
This commit is contained in:
committed by
David Peter
parent
3729aefb6f
commit
5e0a608ea6
23
tests/syntax-tests/source/D/test.d
Normal file
23
tests/syntax-tests/source/D/test.d
Normal file
@@ -0,0 +1,23 @@
|
||||
import std.stdio;
|
||||
import std.algorithm;
|
||||
import std.range;
|
||||
|
||||
/* a multiline comment
|
||||
*
|
||||
*/
|
||||
int the_ultimate_answer() {
|
||||
return 42;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// function call with string literal
|
||||
writeln("Hello World!");
|
||||
|
||||
// an int array declaration
|
||||
int[] arr1 = [1, 2, 3];
|
||||
// a double
|
||||
double d1 = 3.14;
|
||||
// another function call
|
||||
writefln("%s\n%s\n%s\n", arr1, d1, the_ultimate_answer());
|
||||
}
|
Reference in New Issue
Block a user