tile38/tests
Josh Baker 90c2474e3d
Merge pull request #501 from JordanArmstrong/strict-jset-numbers
Strictly check if values passed to JSET are numbers
2019-10-29 15:28:40 -07:00
..
107 Fixed test 2018-10-29 08:16:04 -07:00
README.md Fix nearby with match query invalid results 2019-03-01 06:55:26 -07:00
client_test.go Removed elapsed member for json testing 2019-05-28 09:22:15 -07:00
fence_roaming_test.go Roaming geofence tests 2019-01-10 11:28:29 -07:00
fence_test.go Fixed malformed json for chans command 2019-08-03 10:10:28 -07:00
json_test.go Strictly check if values to JSET are numbers 2019-10-26 23:37:48 -03:00
keys_search_test.go Added RESP output fields test for NEARBY/WITHIN 2019-06-04 10:43:32 -07:00
keys_test.go Adding test for 'not' operator 2019-01-14 11:37:11 -07:00
mock_test.go Removed elapsed member for json testing 2019-05-28 09:22:15 -07:00
scripts_test.go Add distance_to function to the tile38 namespace in lua. 2019-01-04 14:57:00 -08:00
stats_test.go Testing for valid INFO and CLIENT Json output 2019-01-15 11:08:19 -07:00
testcmd_test.go Fix parser for multiple negations. 2019-06-14 10:02:26 -07:00
tests_test.go Add timeout tests. Fix a bug. 2019-04-24 13:20:57 -07:00
timeout_test.go Rework timeouts to allow prepending any command with the TIMEOUT seconds 2019-04-25 14:15:53 -07:00

README.md

Tile38 Integation 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"
            },
		},
    }
}