diff --git a/src/library.c b/src/library.c
index 2bb9e13..b3758b9 100644
|
a
|
b
|
|
| 155 | 155 | if (!STRING_IS_NULL(envvar) && !STRING_IS_EMPTY(envvar)) |
| 156 | 156 | VTABLE_push_string(interp, paths, envvar); |
| 157 | 157 | } |
| 158 | | entry = CONST_STRING(interp, "./"); |
| 159 | | VTABLE_push_string(interp, paths, entry); |
| 160 | 158 | |
| 161 | 159 | /* define library paths */ |
| 162 | 160 | paths = Parrot_pmc_new(interp, enum_class_ResizableStringArray); |
| … |
… |
|
| 168 | 166 | if (!STRING_IS_NULL(envvar) && !STRING_IS_EMPTY(envvar)) |
| 169 | 167 | VTABLE_push_string(interp, paths, envvar); |
| 170 | 168 | } |
| 171 | | entry = CONST_STRING(interp, "./"); |
| 172 | | VTABLE_push_string(interp, paths, entry); |
| 173 | 169 | |
| 174 | 170 | /* define languages paths */ |
| 175 | 171 | paths = Parrot_pmc_new(interp, enum_class_ResizableStringArray); |
| 176 | 172 | VTABLE_set_pmc_keyed_int(interp, lib_paths, |
| 177 | 173 | PARROT_LIB_PATH_LANG, paths); |
| 178 | | entry = CONST_STRING(interp, "./"); |
| 179 | | VTABLE_push_string(interp, paths, entry); |
| 180 | 174 | |
| 181 | 175 | /* define dynext paths */ |
| 182 | 176 | paths = Parrot_pmc_new(interp, enum_class_ResizableStringArray); |
diff --git a/t/library/lib_search_path.t b/t/library/lib_search_path.t
new file mode 100644
index 0000000..62c3cca
|
a
|
b
|
|
| | 1 | #!./parrot |
| | 2 | # Copyright (C) 2011 Parrot Foundation. |
| | 3 | |
| | 4 | =head1 NAME |
| | 5 | |
| | 6 | t/library/lib_search_path.t - testing for proper search path precedence |
| | 7 | |
| | 8 | =head1 SYNOPSIS |
| | 9 | |
| | 10 | This test program verifies that Parrot searches for libraries in the |
| | 11 | proper order. |
| | 12 | |
| | 13 | =head1 AUTHOR |
| | 14 | |
| | 15 | Kevin Polulak (a.k.a. soh_cah_toa) kpolulak@gmail.com |
| | 16 | |
| | 17 | =cut |
| | 18 | |
| | 19 | .const string TESTS = 2 |
| | 20 | |
| | 21 | .sub 'main' :main |
| | 22 | .include 'test_more.pir' |
| | 23 | |
| | 24 | .local pmc lib |
| | 25 | .local pmc lib_cwd |
| | 26 | |
| | 27 | plan(TESTS) |
| | 28 | |
| | 29 | # Verify current working directory isn't searched |
| | 30 | lib_cwd = loadlib 'lib_search_path.t' |
| | 31 | is(lib_cwd, '', 'Verify current working directory not searched') |
| | 32 | |
| | 33 | # Verify runtime/parrot/dynext is searched |
| | 34 | lib = loadlib 'osutils.pir' |
| | 35 | isnt(lib, '', 'Verify runtime/parrot/dynext is searched') |
| | 36 | .end |
| | 37 | |
| | 38 | # Local Variables: |
| | 39 | # mode: pir |
| | 40 | # fill-column: 100 |
| | 41 | # End: |
| | 42 | # vim: expandtab shiftwidth=4 ft=pir: |
| | 43 | |