File: main_test.go

package info (click to toggle)
golang-github-segmentio-encoding 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,468 kB
  • sloc: makefile: 286
file content (23 lines) | stat: -rw-r--r-- 350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"bytes"
	"testing"

	"github.com/segmentio/encoding/json"
)

func TestIssue136(t *testing.T) {
	input := json.RawMessage(` null`)

	got, err := json.Marshal(input)
	if err != nil {
		t.Fatal(err)
	}

	want := bytes.TrimSpace(input)

	if !bytes.Equal(got, want) {
		t.Fatalf("Marshal(%q) = %q, want %q", input, got, want)
	}
}