File: testReadline.rb

package info (click to toggle)
jruby 1.5.1-1
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze
  • size: 46,252 kB
  • ctags: 72,039
  • sloc: ruby: 398,155; java: 169,482; yacc: 3,782; xml: 2,469; ansic: 415; sh: 279; makefile: 78; tcl: 40
file content (21 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'test/minirunit'

require 'readline'

def test_readline_history_size(expected_size)
  test_ok expected_size == Readline::HISTORY.to_a.size, "Wrong number of items in the Readline HISTORY"
end

test_no_exception { Readline::HISTORY.push('string') }
test_readline_history_size 1

test_no_exception { Readline::HISTORY.push(*['line1', 'line2']) }
test_readline_history_size 3

test_no_exception { Readline::HISTORY.push }
test_readline_history_size 3

# basic_word_break_characters
test_equal(" \t\n\"\\'`@$><=;|&{(", Readline.basic_word_break_characters)
test_equal(" hello", Readline.basic_word_break_characters = " hello")
test_equal(" hello", Readline.basic_word_break_characters)