diff --git a/txtar/archive_test.go b/txtar/archive_test.go index 18d61465d7a..e05fd5f748e 100644 --- a/txtar/archive_test.go +++ b/txtar/archive_test.go @@ -52,6 +52,22 @@ some content Files: []File{{"file", []byte("data\r\n")}}, }, }, + { + name: "utf8 and comment", + text: `# This is a test comment +-- hello.txt -- +Hello +-- unicode.txt -- +Go语言 +`, + parsed: &Archive{ + Comment: []byte("# This is a test comment\n"), + Files: []File{ + {"hello.txt", []byte("Hello\n")}, + {"unicode.txt", []byte("Go语言\n")}, + }, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {