diegoles / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

goog.testing.fs.DirectoryEntry getDirectory() behaves differently than goog.fs.DirctoryEntry. #440

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
Perform the following steps once with a goog.fs.DirectoryEntry object and once 
with goog.testing.fs.DirectoryEntry object.

1. Create a directory entry as a child of another directory
/hello/.
2. call fs.getRoot().getDirectory('/hello/.')

What is the expected output?
The corresponding directory entry is returned in a Deferred.

What do you see instead?
when the fs.getRoot() is a mock class goog.testing.fs.DirectoryEntry it failes 
to find the corresponding directory and throws exception.

I believe the problem is in testing/fs/entry.js line 467 (the dot at the end 
result in subdir being undefined).
466 goog.array.forEach(components.slice(0, -1), function(p) {                   

467     var subdir = dir.children[p];                                           

468     if (!subdir) {                                                          

469       throw new goog.fs.Error( 
... }

Original issue reported on code.google.com by dpapad@google.com on 20 Mar 2012 at 1:51

GoogleCodeExporter commented 8 years ago
Correction in step 1
1. Create a directory entry as a child of another directory (in this case child 
of the root directory).
/hello

Original comment by dpapad@google.com on 20 Mar 2012 at 1:52

GoogleCodeExporter commented 8 years ago

Original comment by nn...@google.com on 11 May 2012 at 8:16

GoogleCodeExporter commented 8 years ago
Pinging author.  You're both googlers -- please discuss, and feel free to send 
an internal CL.

Original comment by nn...@google.com on 11 May 2012 at 8:17