Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 537486d

Browse files
author
Gregor Noczinski
committed
#22 Added integration test to ensure replacements of UTF8 characters.
1 parent f70e08a commit 537486d

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

integration_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ func (s *integrationTest) Test_static(c *C) {
4949
c.Assert(etag, Equals, newEtag)
5050
}
5151

52+
func (s *integrationTest) Test_staticWithUtf8(c *C) {
53+
resp, err := http.Get("http://localhost:22792/utf8.txt")
54+
c.Assert(err, IsNil)
55+
56+
defer resp.Body.Close()
57+
content, err := ioutil.ReadAll(resp.Body)
58+
c.Assert(err, IsNil)
59+
c.Assert(string(content), Equals, "电视\n")
60+
}
61+
5262
func (s *integrationTest) Test_staticWithBasicAuth(c *C) {
5363
resp, err := http.Get("http://localhost:22790/text.txt")
5464
c.Assert(err, IsNil)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
电影
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
:22792 {
2+
tls off
3+
root resources/test/integrationTest.Test_static
4+
filter rule {
5+
content_type "text/plain.*"
6+
search_pattern "电影"
7+
replacement "电视"
8+
}
9+
}

0 commit comments

Comments
 (0)