diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2018-01-16 12:03:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-16 12:03:31 -0500 |
commit | 2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7 (patch) | |
tree | e08ff912e1924c06939f314168c3362d6f1ec0de /vendor/golang.org/x/text/internal/catmsg/catmsg_test.go | |
parent | f5c8a71698d0a7a16c68be220e49fe64bfee7f5c (diff) | |
download | chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.tar.gz chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.tar.bz2 chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.zip |
Updated dependencies and added avct/uasurfer (#8089)
* Updated dependencies and added avct/uasurfer
* Added uasurfer to NOTICE.txt
Diffstat (limited to 'vendor/golang.org/x/text/internal/catmsg/catmsg_test.go')
-rw-r--r-- | vendor/golang.org/x/text/internal/catmsg/catmsg_test.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go b/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go index df913a1de..b2a7a9e45 100644 --- a/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go +++ b/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go @@ -71,6 +71,10 @@ func TestCodec(t *testing.T) { m: String("foo"), tests: single("foo", ""), }, { + desc: "affix", + m: &Affix{String("foo"), "\t", "\n"}, + tests: single("\t|foo|\n", ""), + }, { desc: "missing var", m: String("foo${bar}"), enc: "\x03\x03foo\x02\x03bar", @@ -101,6 +105,13 @@ func TestCodec(t *testing.T) { }, tests: single("foo|baz", ""), }, { + desc: "affix with substitution", + m: &Affix{seq{ + &Var{"bar", String("baz")}, + String("foo${bar}"), + }, "\t", "\n"}, + tests: single("\t|foo|baz|\n", ""), + }, { desc: "shadowed variable", m: seq{ &Var{"bar", String("baz")}, @@ -140,7 +151,7 @@ func TestCodec(t *testing.T) { &Var{"bar", incomplete{}}, String("${bar}"), }, - enc: "\x00\t\b\x01\x01\x04\x04\x02bar\x03\x00\x00\x00", + enc: "\x00\t\b\x01\x01\x14\x04\x02bar\x03\x00\x00\x00", // TODO: recognize that it is cheaper to substitute bar. tests: single("bar", ""), }, { @@ -246,7 +257,7 @@ type seq []Message func (s seq) Compile(e *Encoder) (err error) { err = ErrIncomplete - e.EncodeMessageType(First) + e.EncodeMessageType(msgFirst) for _, m := range s { // Pass only the last error, but allow erroneous or complete messages // here to allow testing different scenarios. |