home.social

#gdunit4 — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #gdunit4, aggregated by home.social.

  1. If you are using #gdunit4 and struggle asserting signals - make sure to use the exact same amount of variables when asserting. Otherwise the assert will always timeout.

    class emitter:
    signal test(a,b)

    e = monitor_signals(emitter.new())

    # exact values
    e.test.emit(1,2)
    assert_signal(e).is_emitted(e.test,1,2)

    # any values
    e.test.emit(1,2)
    assert_signal(e).is_emitted(e.test,any(),any())

    # timeout
    e.test.emit(1,2)
    assert_signal(e).is_emitted(e.test)

    #godot #gdscript