代码拉取完成,页面将自动刷新
/*
* Copyright (c) 2013 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Seth Hoenig
* Allan Stockdill-Mander
* Mike Robertson
*/
package mqtt
import (
"testing"
)
func Test_ValidateTopicAndQos_qos3(t *testing.T) {
e := validateTopicAndQos("a", 3)
if e != ErrInvalidQos {
t.Fatalf("invalid error for invalid qos")
}
}
func Test_ValidateTopicAndQos_ES(t *testing.T) {
e := validateTopicAndQos("", 0)
if e != ErrInvalidTopicEmptyString {
t.Fatalf("invalid error for empty topic name")
}
}
func Test_ValidateTopicAndQos_a_0(t *testing.T) {
e := validateTopicAndQos("a", 0)
if e != nil {
t.Fatalf("error from valid NewTopicFilter")
}
}
func Test_ValidateTopicAndQos_H(t *testing.T) {
e := validateTopicAndQos("a/#/c", 0)
if e != ErrInvalidTopicMultilevel {
t.Fatalf("invalid error for bad multilevel topic filter")
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。