DEV Community

David Goyes
David Goyes

Posted on

Swift Testing #12: Asociar un bug a una prueba con .bug()

Suele ser útil identificar y asociar un bug a una prueba que lo reproduzca o que verifique que esté arreglado. Para ello se puede usar el trait bug(_:id:_:) que espera recibir:

  • id del bug que puede ser entero o string.
  • url que representa al bug dentro del sistema de rastreo de incidencias.
  • title representa un comentario para identificar el bug.
@Test(
  "Funcionalidad X",
  .bug("https://swift.testing/issues/12345", id: "12345", "Hay un bug bajo ciertas condiciones")
)
func test1() {
    #expect(1 + 1 == 2)
}
Enter fullscreen mode Exit fullscreen mode

Bibliografía

  • Documentación sobre Swift Testing, aquí.
  • Documentación "Associating bugs with tests", aquí.

Top comments (0)