Skip to content

Commit

Permalink
fixing failed ygen unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ythadhani committed Apr 13, 2023
1 parent 8ff4bad commit 975c72e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
24 changes: 19 additions & 5 deletions ygen/genir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,11 @@ func TestGenerateIR(t *testing.T) {
Kind: SimpleEnumerationType,
TypeName: "enumeration",
ValToYANGDetails: []ygot.EnumDefinition{{
Name: "ONE",
Name: "ONE",
Value: 0,
}, {
Name: "TWO",
Name: "TWO",
Value: 1,
}},
},
},
Expand Down Expand Up @@ -610,9 +612,11 @@ func TestGenerateIR(t *testing.T) {
Kind: SimpleEnumerationType,
TypeName: "enumeration",
ValToYANGDetails: []ygot.EnumDefinition{{
Name: "ONE",
Name: "ONE",
Value: 0,
}, {
Name: "TWO",
Name: "TWO",
Value: 1,
}},
},
},
Expand Down Expand Up @@ -1129,7 +1133,7 @@ func TestGenerateIR(t *testing.T) {
Name: "Simple_Parent_Child_Config_Three",
Kind: 1,
TypeName: "enumeration",
ValToYANGDetails: []ygot.EnumDefinition{{Name: "ONE"}, {Name: "TWO"}},
ValToYANGDetails: []ygot.EnumDefinition{{Name: "ONE", Value: 0}, {Name: "TWO", Value: 1}},
},
},
ModelData: []*gpb.ModelData{{Name: "openconfig-remote"}, {Name: "openconfig-simple"}, {Name: "openconfig-simple-augment2"}, {Name: "openconfig-simple-grouping"}},
Expand Down Expand Up @@ -1695,10 +1699,12 @@ func TestGenerateIR(t *testing.T) {
{
Name: "NORMAL",
DefiningModule: "",
Value: 0,
},
{
Name: "SUPER",
DefiningModule: "",
Value: 1,
},
},
},
Expand Down Expand Up @@ -1726,10 +1732,12 @@ func TestGenerateIR(t *testing.T) {
{
Name: "SATURDAY",
DefiningModule: "",
Value: 0,
},
{
Name: "SUNDAY",
DefiningModule: "",
Value: 1,
},
},
},
Expand All @@ -1749,14 +1757,17 @@ func TestGenerateIR(t *testing.T) {
{
Name: "ONE",
DefiningModule: "",
Value: 0,
},
{
Name: "TWO",
DefiningModule: "",
Value: 1,
},
{
Name: "THREE",
DefiningModule: "",
Value: 2,
},
},
},
Expand All @@ -1776,14 +1787,17 @@ func TestGenerateIR(t *testing.T) {
{
Name: "UN",
DefiningModule: "",
Value: 0,
},
{
Name: "DEUX",
DefiningModule: "",
Value: 1,
},
{
Name: "TROIS",
DefiningModule: "",
Value: 2,
},
},
},
Expand Down
6 changes: 6 additions & 0 deletions ygen/gogen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1914,14 +1914,17 @@ func TestGenGoEnumeratedTypes(t *testing.T) {
{
Name: "VALUE_A",
DefiningModule: "",
Value: 0,
},
{
Name: "VALUE_B",
DefiningModule: "",
Value: 1,
},
{
Name: "VALUE_C",
DefiningModule: "",
Value: 2,
},
},
},
Expand All @@ -1939,14 +1942,17 @@ func TestGenGoEnumeratedTypes(t *testing.T) {
1: {
Name: "VALUE_A",
DefiningModule: "",
Value: 0,
},
2: {
Name: "VALUE_B",
DefiningModule: "",
Value: 1,
},
3: {
Name: "VALUE_C",
DefiningModule: "",
Value: 2,
},
},
},
Expand Down

0 comments on commit 975c72e

Please sign in to comment.