-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestclip.rb
executable file
·30 lines (24 loc) · 939 Bytes
/
testclip.rb
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
#!/usr/bin/ruby
# testclip, by Danny R. Faught and inspired by James Bach's perlclip code
# Copyright 2016 and licensed under GPLv3
# This script generates "counterstrings" - self-documenting test data like
# "*3*5*7*10*" and "2*4*6*8*11*" that help you test various string lengths.
# If you report the status of the tests run with the counterstrings, the
# script will help you use bisection to find exactly what point when
# increasing the string length that a failure or other behavior change occurs.
# This script is designed for MacOS (small changes to pbcopy can make it portable elsewhere)
require_relative "commandProcessor"
require "readline"
#
# Main loop
#
puts 'Ready to generate. Type "help" for help.'
processor = CommandProcessor.new
while input = Readline.readline("\n> ", true)
inputArray = input.chomp.split
begin
break if processor.processCommand(*inputArray) == 1
rescue => e
puts e.message
end
end