godot-rust / gdnative

Rust bindings for Godot 3
https://godot-rust.github.io
MIT License
3.62k stars 210 forks source link

PR #886 broke optional argument error reporting #967

Closed chitoyuu closed 1 year ago

chitoyuu commented 2 years ago

From the relevant parts of the test suite:

Before commit https://github.com/godot-rust/godot-rust/commit/619e7d46b7615ae4ed77d7debef7ed28cd537fda (expected):

-- _test_optional_args
   -- expected error messages for edge cases:
     -- missing non-optional parameter `b` (#1)
     -- 1 excessive argument is given: [I64(6)]
   -- the test is successful when and only when these errors are shown
ERROR: missing non-optional parameter `b` (#1)
   at: OptionalArgs :: opt_sum (test/src/lib.rs:195)
ERROR: an excessive argument is given: I64(6)
   at: OptionalArgs :: opt_sum (test/src/lib.rs:195)

After:

   -- expected error messages for edge cases:
     -- missing non-optional parameter `b` (#1)
     -- 1 excessive argument is given: [I64(6)]
   -- the test is successful when and only when these errors are shown
ERROR: missing non-optional parameter `b` (#1)
   at: OptionalArgs :: opt_sum (test/src/lib.rs:173)
ERROR: 6 excessive arguments are given: [I64(1), I64(2), I64(3), I64(4), I64(5), I64(6)]
   at: OptionalArgs :: opt_sum (test/src/lib.rs:173)

I wonder if there's any way this test can be automated. grep in the CI script might be an option?