Aprenda Go 🇧🇷 Cap. 27 – Testes & Benchmarks – 1. Introdução
Cap. 27 – Testes & Benchmarks – 1. Introdução Transcript and Lesson Notes
- Testes devem: - ficar num arquivo cuja terminação seja _test.go - ficar na mesma package que o código a ser testado - ficar em funções com nome "func TestNome(*testing.T)" - Para rodar os testes: - go test - go test -v
Quick Summary
- Testes devem: - ficar num arquivo cuja terminação seja _test.go - ficar na mesma package que o código a ser testado - ficar em funções com nome "func TestNome(*testing.T)" - Para rodar os testes: - go test - go test -v
Key Takeaways
- Review the core idea: - Testes devem: - ficar num arquivo cuja terminação seja _test.go - ficar na mesma package que o código a ser testado - ficar em funções com nome "func TestNome(*testing.T)" - Para rodar os testes: - go test - go test -v
- Understand how go fits into Cap. 27 – Testes & Benchmarks – 1. Introdução.
- Understand how golang fits into Cap. 27 – Testes & Benchmarks – 1. Introdução.
- Understand how programacao fits into Cap. 27 – Testes & Benchmarks – 1. Introdução.
- Understand how programar fits into Cap. 27 – Testes & Benchmarks – 1. Introdução.
Key Concepts
Full Transcript
- Testes devem: - ficar num arquivo cuja terminação seja _test.go - ficar na mesma package que o código a ser testado - ficar em funções com nome "func TestNome(*testing.T)" - Para rodar os testes: - go test - go test -v - Para falhas, utilizamos t.Error(), onde a maneira idiomática é algo do tipo "expected: x. got: y." - Código: https://github.com/ellenkorbes/aprendago/tree/master/c%C3%B3digo/27_testes-e-benchmarking/01_introducao
Lesson FAQs
What is Cap. 27 – Testes & Benchmarks – 1. Introdução about?
- Testes devem: - ficar num arquivo cuja terminação seja _test.go - ficar na mesma package que o código a ser testado - ficar em funções com nome "func TestNome(*testing.T)" - Para rodar os testes: - go test - go test -v
What key concepts are covered in this lesson?
The lesson covers go, golang, programacao, programar, programação.
What should I learn before Cap. 27 – Testes & Benchmarks – 1. Introdução?
Review the previous lessons in Aprenda Go 🇧🇷, then use the transcript and key concepts on this page to fill any gaps.
How can I practice after this lesson?
Practice by applying the main concepts: go, golang, programacao, programar.
Does this lesson include a transcript?
Yes. The full transcript is visible on this page in indexable HTML sections.
Is this lesson free?
Yes. CourseHive lessons and courses are available to learn online for free.
