5 suite_setup: function () {
6 this.completer = new all_word_completer(
7 $completions = ["the quick brown fox",
9 "the lazy dog's tail"]);
11 test_all_word_completer_1: function () {
12 var completions = this.completer.complete("he", 2, false);
13 assert_equals(completions.count, 2);
14 assert_equals(completions.get_value(0), "the quick brown fox");
15 assert_equals(completions.get_value(1), "the lazy dog's tail");
17 test_all_word_completer_2: function () {
18 var completions = this.completer.complete("ic he", 2, false);
19 assert_equals(completions.count, 1);
20 assert_equals(completions.get_value(0), "the quick brown fox");
25 suite_setup: function () {
26 this.completer = new prefix_completer(
27 $completions = ["the quick brown fox",
29 "the lazy dog's tail"]);
31 test_prefix_completer_1: function () {
32 var completions = this.completer.complete("the", 2, false);
33 assert_equals(completions.count, 2);
34 assert_equals(completions.get_value(0), "the lazy dog's tail");
35 assert_equals(completions.get_value(1), "the quick brown fox");
40 suite_setup: function () {
48 this.completer = new javascript_completer(scope);
50 test_javascript_completer_1: function () {
51 var completions = this.completer.complete("a", 1, false);
52 assert_equals(completions.count, 1);
54 test_javascript_completer_2: function () {
55 var completions = this.completer.complete("b", 1, false);
56 assert_equals(completions.count, 3);
58 test_javascript_completer_3: function () {
59 var completions = this.completer.complete("ba", 2, false);
60 assert_equals(completions.count, 2);