tile38/tests
tidwall 3cb8e0509a Thread safe log and support for concurrent tile38 instances 2022-09-26 10:02:02 -07:00
..
107 Use struct for server options 2021-09-29 07:19:00 -07:00
616 Update btree/buntdb 2021-07-31 07:42:58 -07:00
README.md Fix nearby with match query invalid results 2019-03-01 06:55:26 -07:00
aof_test.go wip - aof tests 2022-09-25 03:54:22 -07:00
client_test.go Better CLIENT tests 2022-09-24 13:41:36 -07:00
fence_roaming_test.go wip - better tests 2022-09-23 07:30:03 -07:00
fence_test.go wip - better tests 2022-09-23 07:30:03 -07:00
json_test.go Updated dependencies 2020-09-22 16:43:58 -07:00
keys_search_test.go Better HEALTHZ tests 2022-09-23 17:34:09 -07:00
keys_test.go Better INFO tests 2022-09-24 14:28:47 -07:00
metrics_test.go Thread safe log and support for concurrent tile38 instances 2022-09-26 10:02:02 -07:00
mock_io_test.go Better CLIENT tests 2022-09-24 13:41:36 -07:00
mock_test.go Thread safe log and support for concurrent tile38 instances 2022-09-26 10:02:02 -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 feat: add sector 2021-09-05 11:48:34 +02:00
tests_test.go Thread safe log and support for concurrent tile38 instances 2022-09-26 10:02:02 -07:00
timeout_test.go Fix hang on empty RESP response 2022-09-24 07:22:39 -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"
            },
		},
    }
}