Skip to content

Commit

Permalink
Ensure toml/v2 output is sane
Browse files Browse the repository at this point in the history
  • Loading branch information
jspc committed Mar 9, 2022
1 parent 811f9ea commit 96e878d
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions config/config_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"fmt"
"testing"
)

Expand All @@ -23,18 +24,11 @@ func TestLoadConfig(t *testing.T) {
}
}

func TestConfig_String(t *testing.T) {
defer func() {
err := recover()
if err != nil {
t.Fatalf("unexpected error: %#v", err)
}
}()

c := Config{}.String()
expect := "CFLAGS = \"\"\nCXXFLAGS = \"\"\nMAKEOPTS = \"\"\nconfigure_flags = \"\"\n"

if expect != c {
t.Errorf("expected:\n%sreceived:\n%s", expect, c)
}
func ExampleConfig_String() {
fmt.Println(Config{}.String())
// Output:
// configure_flags = ''
// MAKEOPTS = ''
// CFLAGS = ''
// CXXFLAGS = ''
}

0 comments on commit 96e878d

Please sign in to comment.