3 Commits

Author SHA1 Message Date
b71333dff6
all: don't automatically convert userdata types to pointer types
One of the things I have not learned but done a better job of
internalizing while working with zig over the last few months is that
the less magic that exists, the better. In the case of parameterized
functions, this means that it is much better to restrict the range of
types that are permitted to be passed than to perform type
manipulation. In other words, it's more confusing to see a function
that is parameterized with `SomeType` taking a pointer to that type
than having it be parameterized directly to take the pointer.
Obviously there are exceptions to this rule, like std.mem.eql taking
slices of its parameterized type.

In fact, this new approach fixes some edge cases. Null userdata may now
be passed in, since the user can now actually specify an optional
pointer type (e.g. `?*void` may be used to provide always-null
userdata). Additionally, a pointer to a constant value can now be
passed in, which wasn't possible before (this could have been worked
around by use of constCast and being careful, but that's an
exceedingly bad option compared to having the type system work for
you).
2024-01-01 15:19:43 -08:00
d95cbe83e1
tests.util: fix some error edge cases and autogenerate server url
I was originally going to have this generate a random token by default,
but I don't think it matters. the bigger thing would perhaps be to
manage the listen port to avoid conflicts, but this isn't currently a
problem, so I will pretend it won't ever be a problem.
2023-09-03 17:34:29 -07:00
a53b32204d
tests: add subscription method coverage
This resulted in some minor binding fixes. In theory, all the main
wrapped API endpoints are now covered.
2023-09-03 16:28:00 -07:00