Skip to content

Commit

Permalink
Merge pull request #103 from vnayar/bug/avoid-implicit-convert-dstrin…
Browse files Browse the repository at this point in the history
…g-to-string

Fix Compilation Errors with DMD v2.104.0 onward
  • Loading branch information
gedaiu authored Jun 19, 2024
2 parents b6c6bc1 + 7b9be1b commit 3b21cac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions source/fluentasserts/core/message.d
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ void addDiff(ref EvaluationResult result, string actual, string expected) nothro

foreach(diff; diffResult) {
if(diff.operation == Operation.EQUAL) {
result.add(Message(Message.Type.info, diff.text));
result.add(Message(Message.Type.info, diff.text.to!string));
}

if(diff.operation == Operation.INSERT) {
result.add(Message(Message.Type.insert, diff.text));
result.add(Message(Message.Type.insert, diff.text.to!string));
}

if(diff.operation == Operation.DELETE) {
result.add(Message(Message.Type.delete_, diff.text));
result.add(Message(Message.Type.delete_, diff.text.to!string));
}
}
} catch(Exception e) {
Expand Down
12 changes: 6 additions & 6 deletions source/fluentasserts/core/results.d
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ class DiffResult : IResult {
private string getResult(const Diff d) {
final switch(d.operation) {
case Operation.DELETE:
return ResultGlyphs.diffBegin ~ ResultGlyphs.diffDelete ~ d.text ~ ResultGlyphs.diffEnd;
return ResultGlyphs.diffBegin ~ ResultGlyphs.diffDelete ~ d.text.to!string ~ ResultGlyphs.diffEnd;
case Operation.INSERT:
return ResultGlyphs.diffBegin ~ ResultGlyphs.diffInsert ~ d.text ~ ResultGlyphs.diffEnd;
return ResultGlyphs.diffBegin ~ ResultGlyphs.diffInsert ~ d.text.to!string ~ ResultGlyphs.diffEnd;
case Operation.EQUAL:
return d.text;
return d.text.to!string;
}
}

Expand All @@ -318,15 +318,15 @@ class DiffResult : IResult {

foreach(diff; result) {
if(diff.operation == Operation.EQUAL) {
printer.primary(diff.text);
printer.primary(diff.text.to!string);
}

if(diff.operation == Operation.INSERT) {
printer.successReverse(diff.text);
printer.successReverse(diff.text.to!string);
}

if(diff.operation == Operation.DELETE) {
printer.dangerReverse(diff.text);
printer.dangerReverse(diff.text.to!string);
}
}

Expand Down

0 comments on commit 3b21cac

Please sign in to comment.