mirror of https://github.com/tidwall/tile38.git
aa1caa6131
This commit fixes an issue where expressions were silently failing when encountering undefined fields. Instead they should be treating the undefined field like the number zero. This is required to stay compatible with how Tile38 handles zeros. https://tile38.com/commands/intersects/#fields Fixes #754 |
||
---|---|---|
.. | ||
107 | ||
616 | ||
README.md | ||
aof_legacy | ||
aof_test.go | ||
client_test.go | ||
fence_roaming_test.go | ||
fence_test.go | ||
follower_test.go | ||
json_test.go | ||
keys_search_test.go | ||
keys_test.go | ||
metrics_test.go | ||
mock_io_test.go | ||
mock_test.go | ||
monitor_test.go | ||
proto_test.go | ||
scripts_test.go | ||
stats_test.go | ||
testcmd_test.go | ||
tests_test.go | ||
timeout_test.go |
README.md
Tile38 Integration Testing
- Uses Redis protocol
- The Tile38 data is flushed before every
DoBatch
A basic test operation looks something like:
func keys_SET_test(mc *mockServer) error {
return mc.DoBatch([][]interface{}{
{"SET", "fleet", "truck1", "POINT", 33.0001, -112.0001}, {"OK"},
{"GET", "fleet", "truck1", "POINT"}, {"[33.0001 -112.0001]"},
}
}
Using a custom function:
func keys_MATCH_test(mc *mockServer) error {
return mc.DoBatch([][]interface{}{
{"SET", "fleet", "truck1", "POINT", 33.0001, -112.0001}, {
func(v interface{}) (resp, expect interface{}) {
// v is the value as strings or slices of strings
// test will pass as long as `resp` and `expect` are the same.
return v, "OK"
},
},
}
}