Skip to content

Commit 255dc4d

Browse files
authored
Merge pull request #319 from dlang/revert-318-partially-revert-303
Revert "Partially revert #303 until #317 is resolved" merged-on-behalf-of: Vladimir Panteleev <[email protected]>
2 parents 5cc9864 + 40ef433 commit 255dc4d

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

rdmd.d

+10-14
Original file line numberDiff line numberDiff line change
@@ -831,26 +831,23 @@ string innerEvalCode(string[] eval)
831831
import std.string : join, stripRight;
832832
// assumeSafeAppend just to avoid unnecessary reallocation
833833
string code = eval.join("\n").stripRight.assumeSafeAppend;
834-
// Revert https://github.com/dlang/tools/pull/303 until
835-
// https://github.com/dlang/tools/pull/317 has been resolved
836-
//if (code.length > 0 && code[$ - 1] != ';')
837-
//code ~= ';';
834+
if (code.length > 0 && code[$ - 1] != ';')
835+
code ~= ';';
838836
return code;
839837
}
840838

841-
// partially reverted until https://github.com/dlang/tools/pull/317 is resolved
842839
unittest
843840
{
844-
//assert(innerEvalCode([`writeln("Hello!")`]) == `writeln("Hello!");`);
841+
assert(innerEvalCode([`writeln("Hello!")`]) == `writeln("Hello!");`);
845842
assert(innerEvalCode([`writeln("Hello!");`]) == `writeln("Hello!");`);
846843

847844
// test with trailing whitespace
848-
//assert(innerEvalCode([`writeln("Hello!") `]) == `writeln("Hello!");`);
845+
assert(innerEvalCode([`writeln("Hello!") `]) == `writeln("Hello!");`);
849846
assert(innerEvalCode([`writeln("Hello!"); `]) == `writeln("Hello!");`);
850847

851848
// test with multiple entries
852-
//assert(innerEvalCode([`writeln("Hello!"); `, `writeln("You!") `])
853-
//== "writeln(\"Hello!\"); \nwriteln(\"You!\");");
849+
assert(innerEvalCode([`writeln("Hello!"); `, `writeln("You!") `])
850+
== "writeln(\"Hello!\"); \nwriteln(\"You!\");");
854851
assert(innerEvalCode([`writeln("Hello!"); `, `writeln("You!"); `])
855852
== "writeln(\"Hello!\"); \nwriteln(\"You!\");");
856853
}
@@ -894,11 +891,10 @@ unittest
894891
// innerEvalCode already tests the cases for different
895892
// contents in `eval` array, so let's focus on testing
896893
// the difference based on the `loop` flag
897-
// partially reverted until https://github.com/dlang/tools/pull/317 is resolved
898-
//assert(makeEvalCode([`writeln("Hello!") `], No.loop) ==
899-
//importWorld
900-
//~ "void main(char[][] args) {\n"
901-
//~ "writeln(\"Hello!\");\n}");
894+
assert(makeEvalCode([`writeln("Hello!") `], No.loop) ==
895+
importWorld
896+
~ "void main(char[][] args) {\n"
897+
~ "writeln(\"Hello!\");\n}");
902898

903899
assert(makeEvalCode([`writeln("What!"); `], No.loop) ==
904900
importWorld

0 commit comments

Comments
 (0)