SHARE
TWEET

Untitled

a guest Sep 12th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/proto/dwtools/abase/l5.test/Glob.test.s b/proto/dwtools/abase/l5.test/Glob.test.s
  2. index 577779e..cbf20b0 100644
  3. --- a/proto/dwtools/abase/l5.test/Glob.test.s
  4. +++ b/proto/dwtools/abase/l5.test/Glob.test.s
  5. @@ -370,12 +370,42 @@ function globFilter( test )
  6.  {
  7.    let path = _.path;
  8.  
  9. +  test.case = 'empty right glob';
  10. +  var expected = [];
  11. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  12. +  var got = path.globFilter( src, '' );
  13. +  test.identical( got, expected );
  14. +
  15. +  test.case = 'empty right glob';
  16. +  var expected = [];
  17. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  18. +  var got = path.globFilter( src, 'z*' );
  19. +  test.identical( got, expected );
  20. +
  21. +  test.case = 'empty right glob';
  22. +  var expected = [];
  23. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  24. +  var got = path.globFilter( src, 'za*' );
  25. +  test.identical( got, expected );
  26. +
  27. +  test.case = 'empty right glob';
  28. +  var expected = [];
  29. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  30. +  var got = path.globFilter( src, '*az' );
  31. +  test.identical( got, expected );
  32. +
  33.    test.case = 'empt right glob';
  34.    var expected = [];
  35.    var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  36.    var got = path.globFilter( src, 'b*' );
  37.    test.identical( got, expected );
  38.  
  39. +  test.case = 'empty right glob';
  40. +  var expected = [];
  41. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  42. +  var got = path.globFilter( src, 'dbba' );
  43. +  test.identical( got, expected );
  44. +
  45.    test.case = 'right glob';
  46.    var expected = [ 'dbb', 'dab' ];
  47.    var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  48. @@ -406,6 +436,31 @@ function globFilter( test )
  49.    var got = path.globFilter( src, 'abd' );
  50.    test.identical( got, expected );
  51.  
  52. +  test.case = 'repeat glob';
  53. +  var expected = [ 'dbb' ];
  54. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  55. +  var got = path.globFilter( src, '*bb' );
  56. +  test.identical( got, expected );
  57. +
  58. +  test.case = 'any glob';
  59. +  var expected = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  60. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab' ];
  61. +  var got = path.globFilter( src, '*' );
  62. +  test.identical( got, expected );
  63. +
  64. +  test.case = 'right glob double b';
  65. +  var expected = [ 'dbb' ];
  66. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab', 'dbba' ];
  67. +  var got = path.globFilter( src, '*bb' );
  68. +  test.identical( got, expected );
  69. +
  70. +  # Failing. Why?
  71. +  test.case = 'right glob double middle b';
  72. +  var expected = [ 'dbba' ];
  73. +  var src = [ 'abc', 'abd', 'adb', 'dbb', 'dab', 'dbba' ];
  74. +  var got = path.globFilter( src, '*bb*' );
  75. +  test.identical( got, expected );
  76. +
  77.  }
  78.  
  79.  //
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top