#!/usr/bin/env ruby puts < #include #include #include #include "r3.h" #include "r3_str.h" #include "zmalloc.h" START_TEST (test_routes) { node * n = r3_tree_create(10); node * m = NULL; END arr = ["foo", "bar", "baz", "qux", "quux", "corge", "grault", "garply"] paths = arr.permutation(3).map { |a| "/#{a.join '/'}" } paths.each_index do |idx| path = paths.fetch(idx) puts " char *data#{idx} = \"#{path}\";" puts " r3_tree_insert_path(n, \"#{path}\", (void*) data#{idx});" end puts <data == data#{idx});" puts " ck_assert_int_gt(m->endpoint, 0);" end puts <