X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=ns_test.go;h=e4ca00a43ae7fe67eb2b8c160d0de8dba9282367;hb=HEAD;hp=c3a138a1ad53926ff0303a989dc2a15a75e77eec;hpb=e81a692325b0d36a34fa521847dd38f22433cbb8;p=netstring.git diff --git a/ns_test.go b/ns_test.go index c3a138a..e4ca00a 100644 --- a/ns_test.go +++ b/ns_test.go @@ -1,19 +1,17 @@ -/* -netstring -- netstring format serialization library -Copyright (C) 2015-2023 Sergey Matveev - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 3 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ +// netstring -- netstring format serialization library +// Copyright (C) 2015-2024 Sergey Matveev +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, version 3 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . package netstring @@ -107,19 +105,7 @@ func TestErrors(t *testing.T) { b = bytes.NewBufferString("0:foobar,") r = NewReader(b) - if _, err := r.Next(); err != nil { - t.FailNow() - } - if _, err := r.Read(data); err == nil { - t.FailNow() - } - - b = bytes.NewBufferString("0:foobar") - r = NewReader(b) - if _, err := r.Next(); err != nil { - t.FailNow() - } - if _, err := r.Read(data); err == nil { + if _, err := r.Next(); err == nil { t.FailNow() }