File: utils_test.go

package info (click to toggle)
golang-github-igm-sockjs-go 3.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 512 kB
  • sloc: javascript: 39; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 393 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package sockjs

import "testing"

func TestQuote(t *testing.T) {
	var quotationTests = []struct {
		input  string
		output string
	}{
		{"simple", "\"simple\""},
		{"more complex \"", "\"more complex \\\"\""},
	}

	for _, testCase := range quotationTests {
		if quote(testCase.input) != testCase.output {
			t.Errorf("Expected '%s', got '%s'", testCase.output, quote(testCase.input))
		}
	}
}