Pārlūkot izejas kodu

x/net/html/charset: fix nacl build

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/177880043
Mikio Hara 11 gadi atpakaļ
vecāks
revīzija
716c3ccf9b
1 mainītis faili ar 15 papildinājumiem un 0 dzēšanām
  1. 15 0
      html/charset/charset_test.go

+ 15 - 0
html/charset/charset_test.go

@@ -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 {