Mercurial > projects > mde
diff mde/gui/widget/layout.d @ 163:24d77c52243f
Provided sensible conversions for setting the value of one AStringContent from another, along with unittest.
Updated layout and Translation unittests to run.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 23 May 2009 15:47:32 +0200 |
parents | 2476790223b8 |
children | da8d3091fdaf |
line wrap: on
line diff
--- a/mde/gui/widget/layout.d Fri May 22 19:59:22 2009 +0200 +++ b/mde/gui/widget/layout.d Sat May 23 15:47:32 2009 +0200 @@ -121,7 +121,7 @@ } override bool dropContent (IContent content) { - if (cList.setContent (content)) + if (cList.set (content)) return true; return parent.dropContent (content); } @@ -919,23 +919,13 @@ } debug (mdeUnitTest) unittest { - bool throws (void delegate() dg) { - bool r = false; - try { - dg(); - } catch (Exception e) { - r = true; - } - return r; - } - AlignColumns a, a2, b; - a = getInstance ("a", 2); - a2 = getInstance ("a", 2); - b = getInstance ("b", 5); + a = getInstance ("a", null, 2, false); + a2 = getInstance ("a", null, 2, false); + b = getInstance ("a", null, 5, true); assert (a is a2); assert (a !is b); - assert (throws ({ getInstance ("a", 4); })); + assert (getInstance ("a", null, 4, false) !is a); a.setup (0, 3); a.spacing = 6;