You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesi贸n a prueba de IA

Antes: $249

Currency
$209
Suscr铆bete

Termina en:

0 D铆as
12 Hrs
23 Min
8 Seg
Curso de Unit Testing en Go

Curso de Unit Testing en Go

Maria Camila Lenis

Maria Camila Lenis

Tu primera prueba unitaria en Go: objeto T

4/15
Resources

Contributions 2

Questions 2

Sort by:

Want to see more contributions, questions and answers from the community?

Por aca les dejo la documentacion del paquete testing

Dentro de la validaci贸n del test TestAddSucess, en el string de t.Errorf, preferible usar %d sobre %q en ambos casos ya que las variables son int, con ello cuando ejecuten sus test con -v podr谩n visualizar el valor correspondiente al entero.

// error
if result != expect {
	t.Errorf("got %q, expected %d", result, expect)
}

// ideal
if result != expect {
	t.Errorf("got %d, expected %d", result, expect)
}