NotHasPrefixFold succeeds if string doesn't have given Go string as prefix after applying Unicode case-folding (so it's a case-insensitive match). Example: str := NewString(t, "Hello World") str.NotHasPrefixFold("Bye")
(value string)
| 771 | // str := NewString(t, "Hello World") |
| 772 | // str.NotHasPrefixFold("Bye") |
| 773 | func (s *String) NotHasPrefixFold(value string) *String { |
| 774 | opChain := s.chain.enter("NotHasPrefixFold()") |
| 775 | defer opChain.leave() |
| 776 | |
| 777 | if opChain.failed() { |
| 778 | return s |
| 779 | } |
| 780 | |
| 781 | if strings.HasPrefix(strings.ToLower(s.value), strings.ToLower(value)) { |
| 782 | opChain.fail(AssertionFailure{ |
| 783 | Type: AssertNotContainsSubset, |
| 784 | Actual: &AssertionValue{s.value}, |
| 785 | Expected: &AssertionValue{value}, |
| 786 | Errors: []error{ |
| 787 | errors.New("expected: string doesn't have prefix (if folded)"), |
| 788 | }, |
| 789 | }) |
| 790 | } |
| 791 | |
| 792 | return s |
| 793 | } |
| 794 | |
| 795 | // HasSuffixFold succeeds if string has given Go string as suffix |
| 796 | // after applying Unicode case-folding (so it's a case-insensitive match). |