NotHasSuffix succeeds if string doesn't have given Go string as suffix Example: str := NewString(t, "Hello World") str.NotHasSuffix("Hello")
(value string)
| 713 | // str := NewString(t, "Hello World") |
| 714 | // str.NotHasSuffix("Hello") |
| 715 | func (s *String) NotHasSuffix(value string) *String { |
| 716 | opChain := s.chain.enter("NotHasSuffix()") |
| 717 | defer opChain.leave() |
| 718 | |
| 719 | if opChain.failed() { |
| 720 | return s |
| 721 | } |
| 722 | |
| 723 | if strings.HasSuffix(s.value, value) { |
| 724 | opChain.fail(AssertionFailure{ |
| 725 | Type: AssertNotContainsSubset, |
| 726 | Actual: &AssertionValue{s.value}, |
| 727 | Expected: &AssertionValue{value}, |
| 728 | Errors: []error{ |
| 729 | errors.New("expected: string doesn't have suffix"), |
| 730 | }, |
| 731 | }) |
| 732 | } |
| 733 | |
| 734 | return s |
| 735 | } |
| 736 | |
| 737 | // HasPrefixFold succeeds if string has given Go string as prefix |
| 738 | // after applying Unicode case-folding (so it's a case-insensitive match). |