Re: [Vala] Unit testing in Vala



On Wed, 2007-12-12 at 23:36 +0100, Mikkel Kamstrup Erlandsen wrote:
I know that glib trunk contains provisions for unit testing, but they
are not yet included in a stable release. This means that the Vala
bindings are unlikely to sport them as we speak, but they could make
an excellent addition to Vala when the next glib release hits the
block.

Unfortunately (by my limited understanding) the GLib devs decided to
go with a pretty odd syntax for their assertions, which might make it
hard to bind. Fx:

  g_assert_cmpstr ("foo", <, "fzz");
  g_assert_cmpstr ("fzz", >, "faa");
  g_assert_cmpstr ("fzz", ==, "fzz");

Will this (insanity) be possible to map to Vala?

Not that easily but we could add special support to valac, so that you
can just use

assert ("foo" < "fzz");

and valac will convert it to the most appropriate assert macro to get
the best debug output.

Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]