Skip to content

Commit

Permalink
[adapt some runnable tests]
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Jun 15, 2024
1 parent 41f64d0 commit 48d9332
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 14 deletions.
1 change: 0 additions & 1 deletion compiler/test/runnable/arrayop.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUNNABLE_PHOBOS_TEST
import std.math;

extern(C) int printf(const char*, ...);

Expand Down
1 change: 0 additions & 1 deletion compiler/test/runnable/dhry.d
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ Deprecation caused by https://issues.dlang.org/show_bug.cgi?id=20645
import core.stdc.stdio;
import core.stdc.string;
import core.stdc.stdlib;
import std.string;


/* Compiler and system dependent definitions: */
Expand Down
4 changes: 2 additions & 2 deletions compiler/test/runnable/extra-files/importc_main.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

import std.stdio;
import core.stdc.stdio;
import importc_test;

int main()
{
auto rc = someCodeInC(3, 4);
writeln("Result of someCodeInC(3,4) = ", rc );
printf("Result of someCodeInC(3,4) = %d\n", rc);
assert( rc == 7, "Wrong result");
return 0;
}
1 change: 0 additions & 1 deletion compiler/test/runnable/extra-files/importc_main2.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

import std.stdio;
import importc_test;

int main()
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/test18076.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

output_file=${OUTPUT_BASE}.log

echo 'import std.stdio; void main() { writeln("Success"); }' | \
echo 'import core.stdc.stdio; void main() { puts("Success"); }' | \
$DMD -m${MODEL} -run - > ${output_file}
grep -q 'Success' ${output_file}

Expand Down
4 changes: 1 addition & 3 deletions compiler/test/runnable/test19.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// REQUIRED_ARGS: -unittest

import std.algorithm: cmp;

extern(C) int printf(const char*, ...);

/* ================================ */
Expand Down Expand Up @@ -269,7 +267,7 @@ void test13()

s1 = s1.dup;
s2 = tolower13(s1);
assert(cmp(s2, "fol") == 0);
assert(s2 == "fol");
assert(s2 == s1);
}

Expand Down
8 changes: 4 additions & 4 deletions compiler/test/runnable/test8544.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// EXECUTE_ARGS: foo bar doo
// PERMUTE_ARGS:
import core.stdc.stdio;
import std.conv;
import core.stdc.string : strlen;
import core.runtime;

void main(string[] args)
Expand All @@ -12,6 +11,7 @@ void main(string[] args)
assert(dArgs.length && cArgs.argc); // ensure we've passed some args
assert(dArgs.length == cArgs.argc);

assert(dArgs[1] == to!string(cArgs.argv[1]));
assert(args[1] == to!string(cArgs.argv[1]));
const cArg = cArgs.argv[1][0 .. strlen(cArgs.argv[1])];
assert(dArgs[1] == cArg);
assert(args[1] == cArg);
}
2 changes: 1 addition & 1 deletion compiler/test/runnable/test9287.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

echo 'import std.stdio; void main() { writeln("Success"); }' | \
echo 'import core.stdc.stdio; void main() { puts("Success"); }' | \
$DMD -m${MODEL} -of${OUTPUT_BASE}${EXE} -

${OUTPUT_BASE}${EXE}
Expand Down

0 comments on commit 48d9332

Please sign in to comment.