MikeSchulze / gdUnit4

A Godot Unit Test Framework. Support for GDScript and C# unit testing
MIT License
565 stars 30 forks source link

GD-531: `assert_not_yet_implemented` reports the wrong line number #531

Closed mathrick closed 2 months ago

mathrick commented 2 months ago

The used GdUnit4 version

4.3.3

The used Godot version

v4.2.2.stable.official [15073afe3]

Operating System

Linux Mint 20 Ulyana

Describe the bug

I just created the first test for my code following the installation, and when I run it, I see the expected not-implemented-yet failure. However, when I click on the error in the test inspector, it tries to send me to a non-existent line number, which also trips an error in the Godot output panel.

The entire test suite:

# GdUnit generated TestSuite
class_name PromiseTest
extends GdUnitTestSuite
@warning_ignore('unused_parameter')
@warning_ignore('return_value_discarded')

# TestSuite generated from
const __source = 'res://addons/card-ui-manager/src/promise.gd'

func test_empty() -> void:
    # remove this line and complete your test
    assert_not_yet_implemented()

Screenshot

As is shown in the screenshot, the actual test is located on line 13, but the inspector thinks it's 43. For reference, I have restarted the Godot editor after installing gdUnit4 (and also after creating the test and running into this issue, to make sure it wasn't a fluke). The first time after a restart, it reports the line number as <n/a>, and doesn't go to the source. I need to run the tests in debug mode for the wrong line to be reported.

Also, in 4.3.1 (as installed from the current AssetLib), the line number reported is 39. After updating to 4.3.3, it changes to 43.

Steps to Reproduce

Example:

  1. Create a new test suite with the default GDScript template
  2. Right-click the test and select "Debug tests"
  3. Click on the error shown

Minimal reproduction project

gdUnit4-repro.zip

MikeSchulze commented 2 months ago

Thanks for reporting this issue.