mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-30 22:11:07 +00:00 
			
		
		
		
	Introduced ErrNotValid
This commit is contained in:
		
					parent
					
						
							
								cb4690e570
							
						
					
				
			
			
				commit
				
					
						c4f9f8578a
					
				
			
		
					 8 changed files with 47 additions and 22 deletions
				
			
		|  | @ -26,9 +26,13 @@ func Test_IsValid(t *testing.T) { | |||
| 		t.Errorf("sut expected to be valid: %v\n", sut.Validate()) | ||||
| 	} | ||||
| 	sut = Sut{valid: false} | ||||
| 	if res, _ := IsValid(sut); res { | ||||
| 	res, err := IsValid(sut) | ||||
| 	if res { | ||||
| 		t.Errorf("sut expected to be invalid: %v\n", sut.Validate()) | ||||
| 	} | ||||
| 	if err == nil || !IsErrNotValid(err) || err.Error() != "Validation Error: validation.Sut: invalid" { | ||||
| 		t.Errorf("validation error expected, but was %v", err) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| func Test_ValidateNotEmpty_ForString(t *testing.T) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue