You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All of these are a bit of an anti-pattern; they mean that the error messages are little more descriptive than "assert_true: Post-wrap export matches original export expected true got false". This is rather little information to go on!
Note that in Safari some of these tests are flaky (see these results) and it's hard to debug what's going on when all I know is true != false.
It would be good to replace equalBuffers with something like the built-in assert_array_equals (and perhaps we should add something built-in to do this, perhaps for typed arrays and data views too, cc @jgraham@stephenmcgruer in case you have views on whether we should have those built-in).
Is there any reason why equalJwk can't use assert_object_equals?
The text was updated successfully, but these errors were encountered:
I would be happy to see some convenience methods in testharness.js for this; whilst it would increase the API space it seems like they would be fairly clear in their usage.
cc @annevk who put a lot of good thought into assert_array_equals when they reworked it, as it turns out producing useful output for differing array-like objects is tricky.
Is there any reason why equalJwk can't use assert_object_equals?
For a start, we're trying to get rid of (well, at least fix) assert_object_equals (#2033), so I would try to avoid introducing more uses till we do that.
assert_array_equals([].slice.call(encoded), bytes) is something https://github.com/web-platform-tests/wpt/blob/master/encoding/api-basics.any.js does and it seems reasonable to have assert_view/buffer_equals that does that for you. Or make assert_array_equals also accept a buffer/view on either side, maybe that's even better.
Currently WebCryptoAPI has a lot of
assert_true(equalBuffers(…))
and a bunch ofassert_true(equalJwk(…))
. Specifically:All of these are a bit of an anti-pattern; they mean that the error messages are little more descriptive than "assert_true: Post-wrap export matches original export expected true got false". This is rather little information to go on!
Note that in Safari some of these tests are flaky (see these results) and it's hard to debug what's going on when all I know is true != false.
It would be good to replace
equalBuffers
with something like the built-inassert_array_equals
(and perhaps we should add something built-in to do this, perhaps for typed arrays and data views too, cc @jgraham @stephenmcgruer in case you have views on whether we should have those built-in).Is there any reason why
equalJwk
can't useassert_object_equals
?The text was updated successfully, but these errors were encountered: