Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kadai2-pei #20

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

kadai2-pei #20

wants to merge 13 commits into from

Conversation

suaaa7
Copy link

@suaaa7 suaaa7 commented Jul 31, 2019

課題2

io.Readerとio.Writerについて調べてみよう

標準パッケージでどのように使われているか

どういう利点があるのか具体例を上げてみる

  • 入力元、出力先に関して、ファイル、標準入出力、メモリ、ネットワーク通信など、それらの切り替えを容易に行うことができる
  • Interfaceとしてio.Reader, io.Writerがあることで、抽象的に読み書きすることが可能になる
    • テストで入出力先を容易に切り替えることができる

1回目の宿題のテストを作ってみて下さい

  • テストのしやすさを考えてリファクタリングしてみる
  • テストのカバレッジを取ってみる
  • テーブル駆動テストを行う
  • テストヘルパーを作ってみる

テストのカバレッジを取ってみる

$ make test
go test -v -cover github.com/gopherdojo/dojo6/kadai2/pei/...
?       github.com/gopherdojo/dojo6/kadai2/pei/cmd      [no test files]
=== RUN   TestConverterWithDir_Convert
--- PASS: TestConverterWithDir_Convert (0.11s)
PASS
coverage: 85.7% of statements
ok      github.com/gopherdojo/dojo6/kadai2/pei/pkg/convdir      0.138s  coverage: 85.7% of statements
=== RUN   TestImgConverter_Convert
--- PASS: TestImgConverter_Convert (0.18s)
PASS
coverage: 50.0% of statements
ok      github.com/gopherdojo/dojo6/kadai2/pei/pkg/imgconv      0.205s  coverage: 50.0% of statements

@suaaa7 suaaa7 added the kadai2 label Jul 31, 2019
@suaaa7 suaaa7 self-assigned this Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant