Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
2c9363d2
authored
2015-03-27 13:43:20 +0800
by
pylemon
Committed by
astaxie
2015-05-25 09:10:35 +0800
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add tests to ensure bool value require test always return true.
1 parent
91886a45
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
validation/validation_test.go
validation/validation_test.go
View file @
2c9363d
...
...
@@ -26,6 +26,12 @@ func TestRequired(t *testing.T) {
if
valid
.
Required
(
nil
,
"nil"
)
.
Ok
{
t
.
Error
(
"nil object should be false"
)
}
if
!
valid
.
Required
(
true
,
"bool"
)
.
Ok
{
t
.
Error
(
"Bool value should always return true"
)
}
if
!
valid
.
Required
(
false
,
"bool"
)
.
Ok
{
t
.
Error
(
"Bool value should always return true"
)
}
if
valid
.
Required
(
""
,
"string"
)
.
Ok
{
t
.
Error
(
"
\"
'
\"
string should be false"
)
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment