Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Commit

Permalink
Apply wording changes rest of the changes and related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrk committed Nov 2, 2016
1 parent 28e1b37 commit bca3f67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func validateOptions(opts *options) error {
}
}
if !isValidColors {
return fmt.Errorf("FlameGraph unknown colors %q. Valid ones are %v", opts.OutputOpts.Colors, validColors)
return fmt.Errorf("FlameGraph unknown colors %q. Valid ones are: %s", opts.OutputOpts.Colors, strings.Join(validColors, ", "))
}
}

Expand All @@ -178,7 +178,7 @@ func buildFlameGraphArgs(opts outputOptions) []string {
args = append(args, "--hash")
}

if opts.ColorPalette {
if opts.ConsistentPalette {
args = append(args, "--cp")
}

Expand Down
8 changes: 4 additions & 4 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ func TestInvalidOptions(t *testing.T) {
},
{
args: []string{"--width", "10"},
errorMessage: "FlameGraph miminal graph with is 1 200 pixels",
errorMessage: "FlameGraph miminal graph width is 1200 pixels",
},
{
args: []string{"--colors", "foo"},
errorMessage: "FlameGraph unknown colors 'foo'",
errorMessage: "FlameGraph unknown colors \"foo\". Valid ones are: hot, mem, io, wakeup, chain, java, js, perl, red, green, blue, aqua, yellow, purple, orange",
},
}

Expand Down Expand Up @@ -127,11 +127,11 @@ func TestFlameGraphArgs(t *testing.T) {

opts.OutputOpts.Hash = true
opts.OutputOpts.Colors = "perl"
opts.OutputOpts.ColorPalette = true
opts.OutputOpts.ConsistentPalette = true
opts.OutputOpts.Reverse = true
opts.OutputOpts.Inverted = true

expectedCommandWithArgs := []string{"--title", "Flame Graph", "--width", "1900", "--colors", "perl",
expectedCommandWithArgs := []string{"--title", "Flame Graph", "--width", "1200", "--colors", "perl",
"--hash", "--cp", "--reverse", "--inverted"}

if !reflect.DeepEqual(expectedCommandWithArgs, buildFlameGraphArgs(opts.OutputOpts)) {
Expand Down

0 comments on commit bca3f67

Please sign in to comment.