Skip to content

Commit

Permalink
Fix test cases to account for new sorted order
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSGK committed Oct 16, 2024
1 parent 299a574 commit 53588cd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cmd/lekko/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func TestGoSyncToGenToSync(t *testing.T) {
if err != nil {
t.Fatalf("diff: %v", err)
}
t.Fatalf("mismatch in generated code: %s", diff)
t.Fatalf("mismatch in generated code:\n%s", diff)
}

s2 := sync.NewGoSyncer()
Expand Down
14 changes: 7 additions & 7 deletions cmd/lekko/testdata/gertrude.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ type Widget struct {
Size float64
}

func getWidget() *Widget {
return &Widget{
Name: "Terry",
Size: getSize(),
}
func getDirect() float64 {
return getSize()
}

func getSize() float64 {
return 43.1
}

func getDirect() float64 {
return getSize()
func getWidget() *Widget {
return &Widget{
Name: "Terry",
Size: getSize(),
}
}
24 changes: 12 additions & 12 deletions cmd/lekko/testdata/withcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ type BlockedDomains struct {
Domains []string
}

type DefaultEditorModeArgs struct {
Username string
}

// Default editor mode
func getDefaultEditorMode(args *DefaultEditorModeArgs) string {
if args.Username == "non-engineer@lekko.com" {
return "visual"
}
return "code"
}

// Blocked auto-join domains
func getBlockedAutoJoinDomains() *BlockedDomains {
return &BlockedDomains{
Expand All @@ -30,3 +18,15 @@ func getBlockedAutoJoinDomains() *BlockedDomains {
},
}
}

type DefaultEditorModeArgs struct {
Username string
}

// Default editor mode
func getDefaultEditorMode(args *DefaultEditorModeArgs) string {
if args.Username == "non-engineer@lekko.com" {
return "visual"
}
return "code"
}

0 comments on commit 53588cd

Please sign in to comment.