5 * Tests for string urls
8 test_suggest_filename_str_1: function () {
9 assert_equals(suggest_file_name("http://example.com/"),
12 test_suggest_filename_str_2: function () {
13 assert_equals(suggest_file_name("http://www.example.com/"),
14 "www.example.com.html");
16 test_suggest_filename_str_3: function () {
17 assert_equals(suggest_file_name("http://example.com/foo.html"),
20 test_suggest_filename_str_4: function () {
21 assert_equals(suggest_file_name("http://example.com/a/b/c/foo.html"),
24 test_suggest_filename_str_5: function () {
25 assert_equals(suggest_file_name("http://example.com/a/b/c/"),
28 test_suggest_filename_str_6: function () {
29 assert_equals(suggest_file_name("http://example.com/foo.bar/"),
32 test_suggest_filename_str_7: function () {
33 assert_equals(suggest_file_name("http://example.com/foo.bar.baz"),
39 * Tests for load_specs
42 test_suggest_filename_ls_1: function () {
43 var spec = { uri: "http://example.com/", title: "foo" };
44 assert_equals(suggest_file_name(load_spec(spec)), "foo.html");
46 test_suggest_filename_ls_2: function () {
47 var spec = { uri: "http://example.com/", title: "foo.bar" };
48 assert_equals(suggest_file_name(load_spec(spec)), "foo.bar.html");