-
Notifications
You must be signed in to change notification settings - Fork 92
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
zhangbiao
committed
Nov 12, 2019
1 parent
5507861
commit cd9d421
Showing
1 changed file
with
51 additions
and
49 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,55 +1,57 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/gogf/gf/net/ghttp" | ||
"testing" | ||
) | ||
|
||
// | ||
//import ( | ||
// "github.com/gogf/gf/net/ghttp" | ||
// "testing" | ||
//) | ||
// | ||
const ( | ||
TestURL string = "http://127.0.0.1:80" | ||
) | ||
|
||
func TestLogTest(t *testing.T) { | ||
if r, e := ghttp.Get(TestURL + "/tmp/test?name=john&age=18"); e != nil { | ||
t.Error(e) | ||
} else { | ||
t.Log(string(r.ReadAll())) | ||
r.Close() | ||
} | ||
} | ||
|
||
func TestLogPost(t *testing.T) { | ||
if r, e := ghttp.Post(TestURL+"/tmp/access", "name=john&age=18"); e != nil { | ||
t.Error(e) | ||
} else { | ||
t.Log(string(r.ReadAll())) | ||
r.Close() | ||
} | ||
} | ||
|
||
func TestLogGet(t *testing.T) { | ||
if r, e := ghttp.Get(TestURL + "/tmp/access?name=john&age=18"); e != nil { | ||
t.Error(e) | ||
} else { | ||
t.Log(string(r.ReadAll())) | ||
r.Close() | ||
} | ||
} | ||
|
||
func TestLogCache(t *testing.T) { | ||
if r, e := ghttp.Get(TestURL + "/tmp/cache"); e != nil { | ||
t.Error(e) | ||
} else { | ||
t.Log(string(r.ReadAll())) | ||
r.Close() | ||
} | ||
} | ||
|
||
func TestLogMysql(t *testing.T) { | ||
if r, e := ghttp.Get(TestURL + "/tmp/mysql"); e != nil { | ||
t.Error(e) | ||
} else { | ||
t.Log(string(r.ReadAll())) | ||
r.Close() | ||
} | ||
} | ||
// | ||
//func TestLogTest(t *testing.T) { | ||
// if r, e := ghttp.Get(TestURL + "/tmp/test?name=john&age=18"); e != nil { | ||
// t.Error(e) | ||
// } else { | ||
// t.Log(string(r.ReadAll())) | ||
// r.Close() | ||
// } | ||
//} | ||
// | ||
//func TestLogPost(t *testing.T) { | ||
// if r, e := ghttp.Post(TestURL+"/tmp/access", "name=john&age=18"); e != nil { | ||
// t.Error(e) | ||
// } else { | ||
// t.Log(string(r.ReadAll())) | ||
// r.Close() | ||
// } | ||
//} | ||
// | ||
//func TestLogGet(t *testing.T) { | ||
// if r, e := ghttp.Get(TestURL + "/tmp/access?name=john&age=18"); e != nil { | ||
// t.Error(e) | ||
// } else { | ||
// t.Log(string(r.ReadAll())) | ||
// r.Close() | ||
// } | ||
//} | ||
// | ||
//func TestLogCache(t *testing.T) { | ||
// if r, e := ghttp.Get(TestURL + "/tmp/cache"); e != nil { | ||
// t.Error(e) | ||
// } else { | ||
// t.Log(string(r.ReadAll())) | ||
// r.Close() | ||
// } | ||
//} | ||
// | ||
//func TestLogMysql(t *testing.T) { | ||
// if r, e := ghttp.Get(TestURL + "/tmp/mysql"); e != nil { | ||
// t.Error(e) | ||
// } else { | ||
// t.Log(string(r.ReadAll())) | ||
// r.Close() | ||
// } | ||
//} |