No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

common_test.go 534B

123456789101112131415161718192021
  1. package jsh
  2. import "testing"
  3. func TestToJson(t *testing.T) {
  4. fixture := JshFrame{[]string{}, []string{}}
  5. json := fixture.ToJson()
  6. expected := `{"StdOut":[],"StdErr":[]}`
  7. actual := *json
  8. if actual != expected {
  9. t.Errorf("Empty fixture did not match:\n%s != %s", expected, actual)
  10. }
  11. fixture = JshFrame{[]string{"potato!"}, []string{}}
  12. json = fixture.ToJson()
  13. expected = `{"StdOut":["potato!"],"StdErr":[]}`
  14. actual = *json
  15. if actual != expected {
  16. t.Errorf("JSON output did not match:\n%s != %s", expected, actual)
  17. }
  18. }