public
Description: gemified mirror of the tokyotyrant ruby interface
Homepage:
Clone URL: git://github.com/careo/tokyotyrant-ruby.git
Thu Apr 09 10:51:59 -0700 2009
careo (committer)
Mon Apr 20 20:30:40 -0700 2009
tokyotyrant-ruby / test.rb
100755 31 lines (26 sloc) 0.837 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /usr/bin/ruby
 
require 'rbconfig'
 
commands = [
 
            "tcrtest.rb write 127.0.0.1 10000",
            "tcrtest.rb read 127.0.0.1",
            "tcrtest.rb remove 127.0.0.1",
            "tcrtest.rb rcat 127.0.0.1 1000",
            "tcrtest.rb rcat -shl 10 127.0.0.1 1000",
            "tcrtest.rb rcat -dai 127.0.0.1 1000",
            "tcrtest.rb rcat -ext put 127.0.0.1 1000",
            "tcrtest.rb misc 127.0.0.1 1000",
           ]
rubycmd = Config::CONFIG["bindir"] + "/" + RbConfig::CONFIG['ruby_install_name']
num = 1
commands.each do |command|
  rv = system("#{rubycmd} #{command} >/dev/null")
  if rv
    printf("%03d/%03d: %s: ok\n", num, commands.size, command)
  else
    printf("%03d/%03d: %s: failed\n", num, commands.size, command)
    exit(1)
  end
  num += 1
end
printf("all ok\n")
 
system("rm -rf casket")