Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplifycompositelit: No need to specify type in slice #30

Merged
merged 1 commit into from
Oct 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions prefixfile/slurm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package prefixfile

import (
"bytes"
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestDecodeJSON(t *testing.T) {
Expand Down Expand Up @@ -77,27 +78,27 @@ func TestDecodeJSON(t *testing.T) {

func TestFilterOnVRPs(t *testing.T) {
vrps := []VRPJson{
VRPJson{
{
ASN: uint32(65001),
Prefix: "192.168.0.0/25",
Length: 25,
},
VRPJson{
{
ASN: uint32(65002),
Prefix: "192.168.1.0/24",
Length: 24,
},
VRPJson{
{
ASN: uint32(65003),
Prefix: "192.168.2.0/24",
Length: 24,
},
VRPJson{
{
ASN: uint32(65004),
Prefix: "10.0.0.0/24",
Length: 24,
},
VRPJson{
{
ASN: uint32(65005),
Prefix: "10.1.0.0/24",
Length: 16, // this VRP is broken, maxlength can't be smaller than plen
Expand All @@ -106,14 +107,14 @@ func TestFilterOnVRPs(t *testing.T) {

slurm := SlurmValidationOutputFilters{
PrefixFilters: []SlurmPrefixFilter{
SlurmPrefixFilter{
{
Prefix: "10.0.0.0/8",
},
SlurmPrefixFilter{
{
ASN: uint32(65001),
Prefix: "192.168.0.0/24",
},
SlurmPrefixFilter{
{
ASN: uint32(65002),
},
},
Expand All @@ -128,16 +129,16 @@ func TestFilterOnVRPs(t *testing.T) {
func TestAssertVRPs(t *testing.T) {
slurm := SlurmLocallyAddedAssertions{
PrefixAssertions: []SlurmPrefixAssertion{
SlurmPrefixAssertion{
{
ASN: uint32(65001),
Prefix: "10.0.0.0/8",
Comment: "Hello",
},
SlurmPrefixAssertion{
{
ASN: uint32(65001),
Prefix: "192.168.0.0/24",
},
SlurmPrefixAssertion{
{
ASN: uint32(65003),
Prefix: "192.168.0.0/25",
MaxPrefixLength: 26,
Expand Down