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
a96a7f02
Commit
a96a7f02
authored
Nov 13, 2020
by
Will Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for sufficiency
parent
58cad300
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
schema/gen/go/testStructsContainingMaybe_test.go
schema/gen/go/testStructsContainingMaybe_test.go
+28
-0
No files found.
schema/gen/go/testStructsContainingMaybe_test.go
View file @
a96a7f02
...
...
@@ -171,4 +171,32 @@ func TestStructsContainingMaybe(t *testing.T) {
}
})
})
genAndCompileAndTest
(
t
,
"stroct3"
,
"main"
,
ts
,
adjCfg
,
func
(
t
*
testing
.
T
,
getPrototypeByName
func
(
string
)
ipld
.
NodePrototype
)
{
t
.
Run
(
"insufficient"
,
func
(
t
*
testing
.
T
)
{
nrp
:=
getPrototypeByName
(
"Stroct"
)
t
.
Run
(
"typed-create"
,
func
(
t
*
testing
.
T
)
{
b
:=
nrp
.
NewBuilder
()
mb
,
err
:=
b
.
BeginMap
(
0
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
v
,
err
:=
mb
.
AssembleEntry
(
"f1"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
v
.
AssignString
(
"v1"
)
shouldPanicOnBuild
:=
func
(
t
*
testing
.
T
)
{
defer
func
()
{
if
r
:=
recover
();
r
==
nil
{
t
.
Errorf
(
"The code did not panic"
)
}
}()
_
=
b
.
Build
()
}
shouldPanicOnBuild
(
t
)
})
})
})
}
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