This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5196f1e
commit e2a2ab2
Showing
5 changed files
with
32 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package main | ||
|
||
import( | ||
import ( | ||
"testing" | ||
"time" | ||
) | ||
|
||
//"Chat with mdns" will poll for input forever, here just run the main logic to see if there are any runtime errors | ||
func TestMain(t *testing.M){ | ||
func TestMain(t *testing.M) { | ||
timer1 := time.NewTimer(2 * time.Second) | ||
go main() | ||
<-timer1.C | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
package main | ||
|
||
import( | ||
import ( | ||
"testing" | ||
"time" | ||
) | ||
|
||
//"Chat with rendezvous" will poll for input forever, here just run the main logic to see if there are any runtime errors | ||
//FIXME: As of the time of writing, Chat with rendezvous doesn't work properly, yet this test does not fail. | ||
func TestMain(t *testing.M){ | ||
func TestMain(t *testing.M) { | ||
timer1 := time.NewTimer(2 * time.Second) | ||
go main() | ||
<-timer1.C | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
package main | ||
|
||
import( | ||
"testing" | ||
"time" | ||
import ( | ||
"testing" | ||
"time" | ||
) | ||
|
||
//"Chat" will poll for input forever, here just run the main logic to see if there are any runtime errors | ||
func TestMain(t *testing.M){ | ||
timer1 := time.NewTimer(2 * time.Second) | ||
go main() | ||
<-timer1.C | ||
func TestMain(t *testing.M) { | ||
timer1 := time.NewTimer(2 * time.Second) | ||
go main() | ||
<-timer1.C | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
ma "github.com/multiformats/go-multiaddr" | ||
"log" | ||
"testing" | ||
"fmt" | ||
ma "github.com/multiformats/go-multiaddr" | ||
"log" | ||
"testing" | ||
) | ||
|
||
// send an echo from port 7001 to port 7000 | ||
func TestMain(m *testing.M) { | ||
|
||
listenHost, err := makeBasicHost(7000, false, 0) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
// Build host multiaddress | ||
hostAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/ipfs/%s", listenHost.ID().Pretty())) | ||
addr := listenHost.Addrs()[0] | ||
fullAddr := addr.Encapsulate(hostAddr) | ||
listenHost, err := makeBasicHost(7000, false, 0) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
// Build host multiaddress | ||
hostAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/ipfs/%s", listenHost.ID().Pretty())) | ||
addr := listenHost.Addrs()[0] | ||
fullAddr := addr.Encapsulate(hostAddr) | ||
|
||
pingHost, err := makeBasicHost(7001, false, 0) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
pingHost, err := makeBasicHost(7001, false, 0) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
go echo("", listenHost) | ||
echo(fullAddr.String(), pingHost) | ||
go echo("", listenHost) | ||
echo(fullAddr.String(), pingHost) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ import ( | |
"testing" | ||
) | ||
|
||
func TestMain(t *testing.M){ | ||
func TestMain(t *testing.M) { | ||
go main() | ||
} |