Changeset 12424


Ignore:
Timestamp:
02/06/10 15:22:47 (12 years ago)
Author:
Mark Evenson
Message:

Further tests for jar pathnames.

jar-file.lisp now has network based FASL loads.

Additional associated Java unit tests.

Location:
trunk/abcl/test
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/test/lisp/abcl/jar-file.lisp

    r12402 r12424  
    129129  t)
    130130
     131;;; wrapped in PROGN for easy disabling without a network connection
     132;;; XXX come up with a better abstraction
     133(progn
     134  (deftest jar-file.load.11
     135      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/foo")
     136    t)
     137
     138  (deftest jar-file.load.12
     139      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/bar")
     140    t)
     141
     142  (deftest jar-file.load.13
     143      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/bar.abcl")
     144    t)
     145
     146  (deftest jar-file.load.14
     147      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/eek")
     148    t)
     149
     150  (deftest jar-file.load.15
     151      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/eek.lisp")
     152    t)
     153
     154  (deftest jar-file.load.16
     155      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/a/b/foo")
     156    t)
     157
     158  (deftest jar-file.load.17
     159      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/a/b/bar")
     160    t)
     161
     162  (deftest jar-file.load.18
     163      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/a/b/bar.abcl")
     164    t)
     165
     166  (deftest jar-file.load.19
     167      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/a/b/eek")
     168    t)
     169
     170  (deftest jar-file.load.20
     171      (load "jar:http://abcl-dynamic-install.googlecode.com/files/baz.jar!/a/b/eek.lisp")
     172    t))
     173
     174
    131175(deftest jar-file.probe-file.1
    132176    (with-jar-file-init
     
    165209(deftest jar-file.merge-pathnames.2
    166210    (merge-pathnames
    167      "/bar.abcl" #p"jar:file:baz.jar!/foo/")
     211     "bar.abcl" #p"jar:file:baz.jar!/foo/")
    168212  #p"jar:file:baz.jar!/foo/bar.abcl")
    169213
     
    172216     "jar:file:baz.jar!/foo" "bar")
    173217  #p"jar:file:baz.jar!/foo")
     218
     219(deftest jar-file.merge-pathnames.4
     220    (merge-pathnames
     221     "jar:file:baz.jar!/foo" "/a/b/c")
     222  #p"jar:file:/a/b/baz.jar!/foo")
    174223
    175224(deftest jar-file.truename.1
  • trunk/abcl/test/src/org/armedbear/lisp/PathnameTest.java

    r12403 r12424  
    3939  @Test
    4040  public void getInputStream() throws IOException {
    41     File file = File.createTempFile("foo", "lisp");
     41    File file = File.createTempFile("foo", ".lisp");
    4242    FileWriter output = new FileWriter(file);
    4343    String contents = "(defun foo () 42)";
     
    5454    }
    5555    assertEquals(contents, result.toString());
     56    input.close();
    5657    file.delete();
    5758  }
     59
     60  @Test
     61  public void copyConstructor() {
     62      Pathname orig = new Pathname("/a/b/c/d/e/foo.lisp");
     63      Pathname copy = new Pathname(orig.getNamestring());
     64      assertTrue(orig.getNamestring().equals(copy.getNamestring()));
     65  }
     66
     67  @Test
     68  public void mergePathnames1() {
     69      Pathname p = new Pathname("a/b/c/d/foo.lisp");
     70      Pathname d = new Pathname("/foo/bar/there");
     71      Pathname r = Pathname.mergePathnames(p, d);
     72      String s = r.getNamestring();
     73      assertTrue(s.equals("/foo/bar/a/b/c/d/foo.lisp"));
     74  }
     75
     76  @Test
     77  public void mergePathnames2() {
     78      Pathname p = new Pathname("/a/b/c/d/foo.lisp");
     79      Pathname d = new Pathname("/foo/bar/there");
     80      Pathname r = Pathname.mergePathnames(p, d);
     81      assertTrue(r.getNamestring().equals("/a/b/c/d/foo.lisp"));
     82  }
     83
     84  @Test
     85  public void mergePathnames3() {
     86      LispObject args = Lisp.NIL;
     87      args = args.push(Keyword.TYPE);
     88      args = args.push(new SimpleString("abcl-tmp"));
     89      args = args.nreverse();
     90      Pathname p = Pathname.makePathname(args);
     91      Pathname d = new Pathname("/foo/bar.abcl");
     92      Pathname r = Pathname.mergePathnames(p, d);
     93      assertTrue(r.getNamestring().equals("/foo/bar.abcl-tmp"));
     94  }
     95
     96  @Test
     97  public void mergePathnames4() {
     98      Pathname p = new Pathname("jar:file:foo.jar!/bar.abcl");
     99      Pathname d = new Pathname("/a/b/c/");
     100      Pathname r = Pathname.mergePathnames(p, d);
     101      String s = r.getNamestring();
     102      assertTrue(s.equals("jar:file:/a/b/c/foo.jar!/bar.abcl"));
     103  }
    58104}
  • trunk/abcl/test/src/org/armedbear/lisp/StreamTest.java

    r12403 r12424  
    2727    LispObject o = in.read(false, Lisp.EOF, false, LispThread.currentThread());
    2828    assertFalse(o.equals(Lisp.NIL));
     29    in._close();
    2930    file.delete();
    3031  }
Note: See TracChangeset for help on using the changeset viewer.