]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/tx_test.go
Merge branch 'develop'
[nncp.git] / src / tx_test.go
index 6c0aa78569b8adb5f3471590bf0dadb203a73371..2dccbc3d32eb341f1f657ad0d8a38b778c61f5f2 100644 (file)
@@ -21,9 +21,8 @@ import (
        "bytes"
        "crypto/rand"
        "io"
-       "io/ioutil"
        "os"
-       "path"
+       "path/filepath"
        "testing"
        "testing/quick"
 
@@ -48,7 +47,7 @@ func TestTx(t *testing.T) {
                        pathSrc = pathSrc[:MaxPathSize]
                }
                hops = hops % 4
-               spool, err := ioutil.TempDir("", "testtx")
+               spool, err := os.MkdirTemp("", "testtx")
                if err != nil {
                        panic(err)
                }
@@ -64,7 +63,7 @@ func TestTx(t *testing.T) {
                nodeTgt := nodeTgtOur.Their()
                ctx := Ctx{
                        Spool:   spool,
-                       LogPath: path.Join(spool, "log.log"),
+                       LogPath: filepath.Join(spool, "log.log"),
                        Debug:   true,
                        Self:    nodeOur,
                        SelfId:  nodeOur.Id,
@@ -86,6 +85,9 @@ func TestTx(t *testing.T) {
                        nodeTgt.Via = append(nodeTgt.Via, node.Id)
                }
                pkt, err := NewPkt(PktTypeExec, replyNice, []byte(pathSrc))
+               if err != nil {
+                       panic(err)
+               }
                src := bytes.NewReader(data)
                dstNode, _, _, err := ctx.Tx(
                        nodeTgt,