From 9f792bdfeb67ef4d7437eaa8d1e4a77ba6cb6cdf Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 30 Dec 2023 19:26:17 -0500 Subject: [PATCH] lol test too i guess --- jsvar.d | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/jsvar.d b/jsvar.d index c03abfb..28418b4 100644 --- a/jsvar.d +++ b/jsvar.d @@ -2871,6 +2871,22 @@ unittest { assert(g.foo()(new Object) == "generic"); } +unittest { + import std.typecons; + + static struct A { + int a; + Nullable!int b; + } + + var a = A(3); + assert(a.a == 3); + assert(a.b == null); + a = A(5, nullable(4)); + assert(a.a == 5); + assert(a.b == 4); +} + bool appearsNumeric(string n) { if(n.length == 0) return false;