diff options
author | xengineering <me@xengineering.eu> | 2023-06-30 13:58:53 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-06-30 13:58:53 +0200 |
commit | 2f1fd4d1ce2c0c2e46fcfa1ffedfd84f0d36484e (patch) | |
tree | 8f6177e668c2737705949bc2fed200eb5e19a974 /xmpp/router_test.go | |
parent | 04746f75ea935266ded4e28edb6ab25c537d50e1 (diff) | |
parent | 3dc04660a87e1b9fabeea0e55a8511d80d34a694 (diff) | |
download | limox-2f1fd4d1ce2c0c2e46fcfa1ffedfd84f0d36484e.tar limox-2f1fd4d1ce2c0c2e46fcfa1ffedfd84f0d36484e.tar.zst limox-2f1fd4d1ce2c0c2e46fcfa1ffedfd84f0d36484e.zip |
Merge branch 'stream-features'
The added code provides a structured way to handle features offered by
the server.
Diffstat (limited to 'xmpp/router_test.go')
-rw-r--r-- | xmpp/router_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xmpp/router_test.go b/xmpp/router_test.go index ea13712..b490778 100644 --- a/xmpp/router_test.go +++ b/xmpp/router_test.go @@ -2,8 +2,8 @@ package xmpp import ( "encoding/xml" - "testing" "strings" + "testing" ) // routerTest contains a single test case for the xmpp.router. The XML element @@ -11,8 +11,8 @@ import ( // test variable inside the corresponding unit test. See TestRouter for // details. type routerTest struct { - xml string - value int + xml string + value int } // TestRouter tests the xmpp/router.go file. The central functionality is the @@ -23,9 +23,10 @@ type routerTest struct { // validated. func TestRouter(t *testing.T) { var testpoint int + var s session - factory := func(tp *int, i int) func([]xml.Token) { - return func([]xml.Token) { + factory := func(tp *int, i int) func(*session, []xml.Token) { + return func(*session, []xml.Token) { *tp = i } } @@ -60,7 +61,7 @@ func TestRouter(t *testing.T) { tokens = append(tokens, xml.CopyToken(token)) } - route(tokens, testRouting) + route(&s, tokens, testRouting) if testpoint != v.value { t.Fatalf("XML element was not routed correctly!\n") |