Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Force code coverage for cases where a literal value is returned. #122
For now, consider this an experiment meant to provoke discussion about code coverage, rather than something meant to be merged right now.
It's been discussed a few times that code coverage tools do not see lines where a literal value are not flagged as executable lines. To wit:
This is an attempt to fix this problem. I'll start by flagging it as "hacky," but – as a library author – I do want visibility into the numerous branches that would otherwise be hidden by this behavior. (Dare I call it a bug?)
I'm hoping that somebody can point me to a "better" solution that doesn't involve compromising on meaningful code coverage.
As an example, look at https://coveralls.io/builds/25338034/source?filename=lib/xgit/core/dir_cache.ex.
See lines 187, 213, 247, … – All of those are marked as executable and when tested locally via this PR.
* master: Fix typo in changelog. (#139) Prepare 0.2.0 release. (#138) Update deps-of-dependencies. (#137) Upgrade to excoveralls 0.11.2. (#136) Update Credo to 1.1.3. (#135) Share code for finding working tree in plumbing command modules. (#134) [API BREAKING] Merge ValidateObject into Object. (#132) Fix up a couple of type specs that should have used FilePath.t. (#131) Introduce `stage` type for index file stage references. (#130) [API BREAKING] Refactor file path code into new module Xgit.Core.FilePath (#129) Introduce a common data type for less-than / equal / greater-than comparisons. (#128) Prepare 0.1.6 release. (#127) Correct @SPEC for WorkingTree.update_dir_cache/3. (#126) Implement Xgit.Plumbing.UpdateIndex.CacheInfo. (#125) Fix a couple of bugs I noticed in update_dir_cache. (#124) Implement Xgit.Repository.WorkingTree.update_dir_cache/3. (#123) # Conflicts: # lib/xgit/core/dir_cache.ex