You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: machine_test.go
    path of file: ./repos/gorgonia/x/vm
    
    the code of the file until where you have to start completion: package xvm

import (
	"context"
	"errors"
	"fmt"
	"log"
	"reflect"
	"testing"
	"time"

	"gorgonia.org/gorgonia"
)

func TestMachine_runAllNodes(t *testing.T) {
	inputC1 := make(chan ioValue, 0)
	outputC1 := make(chan gorgonia.Value, 1)
	inputC2 := make(chan ioValue, 0)
	outputC2 := make(chan gorgonia.Value, 1)

	n1 := &node{
		op:          &sumF32{},
		inputValues: make([]gorgonia.Value, 2),
		outputC:     outputC1,
		inputC:      inputC1,
	}
	n2 := &node{
		op:          &sumF32{},
		inputValues: make([]gorgonia.Value, 2),
		outputC:     output
    
func Test_createNetwork(t *testing.T) {
	g := gorgonia.NewGraph()
	forty := gorgonia.F32(40.0)
	//fortyTwo := gorgonia.F32(42.0)
	two := gorgonia.F32(2.0)
	n1 := gorgonia.NewScalar(g, gorgonia.Float32, gorgonia.WithValue(&forty), gorgonia.WithName("n1"))
	n2 := gorgonia.NewScalar(g, gorgonia.Float32, gorgonia.WithValue(&two), gorgonia.WithName("n2"))

	added, err := gorgonia.Add(n1, n2)
	if err != nil {
		t.Fatal(err)
	}
	i1 := newInput(n1)
	i2 := newInput(n2)
	op := newOp(added, false)

	type args struct {
		ns []*node
		g  *gorgonia.ExprGraph
	}
	tests := []struct {
		name string
		args args
		want *pubsub
	}{
		{
			"simple add operation",
			args{
				ns: []*node{i1, i2, op},
				g:  g,
			},
			&pubsub{
				publishers: []*publisher{
					{
						id: 0,
					},
					{
						id: 1,
					},
				},
				subscribers: []*subscriber{
					{
						id:         2,
						subscriber: make(chan ioValue, 0),
					},
				},
			},
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			got := createNetwork(tt.args.ns, tt.args.g)
			if got == nil && tt.want != nil {
				t.Fail()
			}
			if got != nil && tt.want == nil {
				t.Fail()
			}
			if got == nil && tt.want == nil {
				return
			}
			if got.publishers != nil && tt.want.publishers != nil {
				if len(got.publishers) != len(tt.want.publishers) {
					t.Errorf("bad number of publishers, expected %v, got %v", len(tt.want.publishers), len(got.publishers))
				}
			}
			if got.subscribers != nil && tt.want.subscribers != nil {
				if len(got.subscribers) != len(tt.want.subscribers) {
					t.Errorf("bad number of subscribers, expected %v, got %v", len(tt.want.subscribers), len(got.subscribers))
				}
			}
			for i := range tt.want.publishers {
				want := tt.want.publishers[i]
				got := got.publishers[i]
				if want.id != got.id {
					t.Errorf("bad subscriber id, expected %v, got %v", want.id, got.id)
				}
			}
			for i := range tt.want.subscribers {
				want := tt.want.subscribers[i]
				got := got.subscribers[i]
				if want.id != got.id {
					t.Errorf("bad subscriber id, expected %v, got %v", want.id, got.id)
				}
			}
		})
	}
}