remove ccirrelo/supervisor, update

everything seems to work even though sirupsen is upper case?

:cyfap:
This commit is contained in:
Reed Allman
2017-09-05 11:36:47 -07:00
parent 78ba35fb23
commit 27e43c5d94
397 changed files with 13691 additions and 8828 deletions

View File

@@ -1470,6 +1470,21 @@ func TestJsonLargeInteger(t *testing.T) {
}
}
func TestJsonDecodeNonStringScalarInStringContext(t *testing.T) {
var b = `{"s.true": "true", "b.true": true, "s.false": "false", "b.false": false, "s.10": "10", "i.10": 10, "i.-10": -10}`
var golden = map[string]string{"s.true": "true", "b.true": "true", "s.false": "false", "b.false": "false", "s.10": "10", "i.10": "10", "i.-10": "-10"}
var m map[string]string
d := NewDecoderBytes([]byte(b), testJsonH)
d.MustDecode(&m)
if err := deepEqual(golden, m); err == nil {
logT(t, "++++ match: decoded: %#v", m)
} else {
logT(t, "---- mismatch: %v ==> golden: %#v, decoded: %#v", err, golden, m)
failT(t)
}
}
// TODO:
// Add Tests for:
// - decoding empty list/map in stream into a nil slice/map

View File

@@ -702,7 +702,9 @@ LOOP:
switch state {
case 0:
state = 2
// do not add sign to the slice ...
if storeBytes {
d.bs = append(d.bs, b)
}
b, eof = r.readn1eof()
continue
case 6: // typ = jsonNumFloat
@@ -715,7 +717,9 @@ LOOP:
case 0:
state = 2
n.neg = true
// do not add sign to the slice ...
if storeBytes {
d.bs = append(d.bs, b)
}
b, eof = r.readn1eof()
continue
case 6: // typ = jsonNumFloat
@@ -981,16 +985,28 @@ func (d *jsonDecDriver) appendStringAsBytes() {
d.tok = b
}
// handle null as a string
if d.tok == 'n' {
d.readStrIdx(10, 13) // ull
d.bs = d.bs[:0]
if d.tok != '"' {
// d.d.errorf("json: expect char '%c' but got char '%c'", '"', d.tok)
// handle non-string scalar: null, true, false or a number
switch d.tok {
case 'n':
d.readStrIdx(10, 13) // ull
d.bs = d.bs[:0]
case 'f':
d.readStrIdx(5, 9) // alse
d.bs = d.bs[:5]
copy(d.bs, "false")
case 't':
d.readStrIdx(1, 4) // rue
d.bs = d.bs[:4]
copy(d.bs, "true")
default:
// try to parse a valid number
d.decNum(true)
}
return
}
if d.tok != '"' {
d.d.errorf("json: expect char '%c' but got char '%c'", '"', d.tok)
}
d.tok = 0
v := d.bs[:0]
@@ -1159,6 +1175,7 @@ func (d *jsonDecDriver) DecodeNaked() {
type JsonHandle struct {
textEncodingType
BasicHandle
// RawBytesExt, if configured, is used to encode and decode raw bytes in a custom way.
// If not configured, raw bytes are encoded to/from base64 text.
RawBytesExt InterfaceExt

View File

@@ -155,8 +155,8 @@ _codegenerators() {
# remove (M|Unm)arshalJSON implementations, so they don't conflict with encoding/json bench \
if [[ $zexternal == "1" ]]
then
sed -i 's+ MarshalJSON(+ _MarshalJSON(+g' values_ffjson${zsfx} && \
sed -i 's+ UnmarshalJSON(+ _UnmarshalJSON(+g' values_ffjson${zsfx}
sed -i '' -e 's+ MarshalJSON(+ _MarshalJSON(+g' values_ffjson${zsfx} && \
sed -i '' -e 's+ UnmarshalJSON(+ _UnmarshalJSON(+g' values_ffjson${zsfx}
fi && \
echo "generators done!" && \
true

View File

@@ -84,7 +84,7 @@ def doRpcServer(port, stopTimeSec):
def EchoStruct(self, msg):
return ("%s" % msg)
addr = msgpackrpc.Address('localhost', port)
addr = msgpackrpc.Address('127.0.0.1', port)
server = msgpackrpc.Server(EchoHandler())
server.listen(addr)
# run thread to stop it after stopTimeSec seconds if > 0
@@ -96,14 +96,14 @@ def doRpcServer(port, stopTimeSec):
server.start()
def doRpcClientToPythonSvc(port):
address = msgpackrpc.Address('localhost', port)
address = msgpackrpc.Address('127.0.0.1', port)
client = msgpackrpc.Client(address, unpack_encoding='utf-8')
print client.call("Echo123", "A1", "B2", "C3")
print client.call("EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"})
def doRpcClientToGoSvc(port):
# print ">>>> port: ", port, " <<<<<"
address = msgpackrpc.Address('localhost', port)
address = msgpackrpc.Address('127.0.0.1', port)
client = msgpackrpc.Client(address, unpack_encoding='utf-8')
print client.call("TestRpcInt.Echo123", ["A1", "B2", "C3"])
print client.call("TestRpcInt.EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"})