Skip to content

Commit

Permalink
Add code from issue 17269 as unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach authored and CromFr committed Jan 31, 2021
1 parent f1ff009 commit 06689a6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions std/format.d
Original file line number Diff line number Diff line change
Expand Up @@ -3830,6 +3830,20 @@ if (is(AssocArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
assert(w.data == "TestContainer(helloworld)", w.data);
}

// https://issues.dlang.org/show_bug.cgi?id=17269
@safe unittest
{
import std.typecons : Nullable;

struct Foo
{
Nullable!string bar;
}

Foo f;
formatTest(f, "Foo(Nullable.null)");
}

@safe unittest
{
assert(collectExceptionMsg!FormatException(format("%d", [0:1])).back == 'd');
Expand Down

0 comments on commit 06689a6

Please sign in to comment.