mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-05 16:56:23 -07:00
25 lines
501 B
Go
25 lines
501 B
Go
package gcutil
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
func TestAPI(t *testing.T) {
|
|
failedPost, _ := MarshalJSON(map[string]interface{}{
|
|
"action": "post",
|
|
"success": false,
|
|
"message": errors.New("Post failed").Error(),
|
|
}, true)
|
|
|
|
madePost, _ := MarshalJSON(map[string]interface{}{
|
|
"action": "post",
|
|
"success": true,
|
|
"board": "test",
|
|
"post": "12345#12346", // JS converts this to /test/res/12345.html#123456
|
|
}, true)
|
|
|
|
t.Log(
|
|
"failedPost:", failedPost,
|
|
"\nmadePost:", madePost)
|
|
}
|