x/net/html/charset: fix nacl build

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/177880043
This commit is contained in:
Mikio Hara
2014-11-17 10:54:21 +09:00
parent dd7a4b48bb
commit 716c3ccf9b

View File

@@ -1,8 +1,13 @@
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package charset
import (
"bytes"
"io/ioutil"
"runtime"
"strings"
"testing"
@@ -129,6 +134,11 @@ var sniffTestCases = []struct {
}
func TestSniff(t *testing.T) {
switch runtime.GOOS {
case "nacl": // platforms that don't permit direct file system access
t.Skipf("not supported on %q", runtime.GOOS)
}
for _, tc := range sniffTestCases {
content, err := ioutil.ReadFile("testdata/" + tc.filename)
if err != nil {
@@ -145,6 +155,11 @@ func TestSniff(t *testing.T) {
}
func TestReader(t *testing.T) {
switch runtime.GOOS {
case "nacl": // platforms that don't permit direct file system access
t.Skipf("not supported on %q", runtime.GOOS)
}
for _, tc := range sniffTestCases {
content, err := ioutil.ReadFile("testdata/" + tc.filename)
if err != nil {