pingcap / failpoint

An implementation of failpoints for Golang.
Apache License 2.0
817 stars 63 forks source link

Return ErrNotAllowed when a term is not allowed #56

Closed shafreeck closed 4 years ago

shafreeck commented 4 years ago

Signed-off-by: Shafreeck Sea shafreeck@gmail.com

What problem does this PR solve?

Return an error when the term is not allowed

For example: 1*return(true) should trigger the fail point once and it returns ErrNotAllowed if Eval is called multiple times.

What is changed and how it works?

Return ErrNotAllowed when a term is not allowed to evaluate.

Check List

Tests

codecov[bot] commented 4 years ago

Codecov Report

Merging #56 into master will increase coverage by 0.2040%. The diff coverage is 100.0000%.

@@               Coverage Diff                @@
##             master        #56        +/-   ##
================================================
+ Coverage   85.7142%   85.9183%   +0.2040%     
================================================
  Files             7          7                
  Lines           980        980                
================================================
+ Hits            840        842         +2     
+ Misses           86         85         -1     
+ Partials         54         53         -1