Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ld
go-ld-prime
Commits
e5b0b8a6
Commit
e5b0b8a6
authored
Feb 06, 2020
by
Eric Myhre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional basic tests around strings.
parent
37dd2d99
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
_rsrch/nodesolution/impls/string_test.go
_rsrch/nodesolution/impls/string_test.go
+11
-0
_rsrch/nodesolution/impls/tests/stringSpecs.go
_rsrch/nodesolution/impls/tests/stringSpecs.go
+24
-0
No files found.
_rsrch/nodesolution/impls/string_test.go
0 → 100644
View file @
e5b0b8a6
package
impls
import
(
"testing"
"github.com/ipld/go-ipld-prime/_rsrch/nodesolution/impls/tests"
)
func
TestString
(
t
*
testing
.
T
)
{
tests
.
SpecTestString
(
t
,
Style__String
{})
}
_rsrch/nodesolution/impls/tests/stringSpecs.go
0 → 100644
View file @
e5b0b8a6
package
tests
import
(
"testing"
.
"github.com/warpfork/go-wish"
ipld
"github.com/ipld/go-ipld-prime/_rsrch/nodesolution"
)
func
SpecTestString
(
t
*
testing
.
T
,
ns
ipld
.
NodeStyle
)
{
t
.
Run
(
"string node"
,
func
(
t
*
testing
.
T
)
{
nb
:=
ns
.
NewBuilder
()
err
:=
nb
.
AssignString
(
"asdf"
)
Wish
(
t
,
err
,
ShouldEqual
,
nil
)
n
:=
nb
.
Build
()
Wish
(
t
,
n
.
ReprKind
(),
ShouldEqual
,
ipld
.
ReprKind_String
)
Wish
(
t
,
n
.
IsNull
(),
ShouldEqual
,
false
)
x
,
err
:=
n
.
AsString
()
Wish
(
t
,
err
,
ShouldEqual
,
nil
)
Wish
(
t
,
x
,
ShouldEqual
,
"asdf"
)
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment