Awn_pastebin

old_Op2oolsTester.js

Oct 27th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //////////////////////////////////////////////////////////////////////////
  2. //
  3. //@title Op2oolsTester.js
  4. //@description Op2oolsのテスト
  5. //@include http://*.open2ch.net/
  6. //@require http://pastebin.com/raw/r7x53V8c
  7. //@private
  8. //
  9. //作った人: Awn(@Awn_tw)
  10. //
  11. //改定履歴
  12. //-201xxxxx(ver 1.0.0): 新規作成
  13. //
  14. //諸注意
  15. //-ご利用は自己責任でお願いします。
  16. //-スクリプトは予告なく修正または廃止されることがあります。
  17. //-コンソールでしか動かない、と思います。
  18. //-悪用は厳禁です。
  19. //-改造改良改悪はご自由にどうぞ。
  20. //
  21. //////////////////////////////////////////////////////////////////////////
  22.  
  23. /********************************************************/
  24. /*[凡例]
  25. /********************************************************/
  26.  
  27. /*--------------------------------*/
  28. //大見出し
  29. /*--------------------------------*/
  30.  
  31. /*----------------*/
  32. //中見出し
  33. /*----------------*/
  34.  
  35. /* 一行見出し */
  36.  
  37. //小見出し
  38.  
  39. //TODO:
  40.  
  41. /********************************************************/
  42.  
  43.  
  44. (function(){
  45. /*--------------------------------*/
  46. //初期化
  47. /*--------------------------------*/
  48. try{Op2ools}catch(e){
  49.     console.warn("SureAnalysis: @require http://pastebin.com/raw/r7x53V8c ");
  50.     console.warn("SureAnalysis: Run Op2ools before this script!");
  51.     return undefined;
  52. }
  53.  
  54. /*--------------------------------*/
  55. //テスト関数
  56. /*--------------------------------*/
  57. var _f = [
  58.     function(n){return ["入力",n];},
  59.     function(){return ["総レス数",Op2ools.getLastResNum()];},
  60.     function(n){return ["レス番号",Op2ools.getRes(n)];},
  61.     function(n){return ["名前欄",Op2ools.getResName(n)];},
  62.     function(n){return ["時間",Op2ools.getResTime(n)];},
  63.     function(n){return ["ID",Op2ools.getResID(n)];},
  64.     function(n){return ["スレ主",Op2ools.isSurenusi(n)];}
  65. ];
  66. var f = function(t){return _f.map(function(elm){return elm(t);});};
  67.  
  68.  
  69. /*--------------------------------*/
  70. //テストケース
  71. /*--------------------------------*/
  72. console.table(f("a test"));
  73. console.table(f(-1));
  74. console.table(f(0));
  75. console.table(f(1));
  76. console.table(f(499));
  77. console.table(f(500));
  78. console.table(f(501));
  79. console.table(f(502));
  80. console.table(f(503));
  81. console.table(f(999));
  82. console.table(f(1000));
  83. console.table(f(1001));
  84. console.table(f(1002));
  85. console.table(f(1003));
  86. console.table(f(1004));
  87. console.table(f(1005));
  88. console.table(f(1006));
  89. console.table(f(19999));
  90.  
  91.  
  92. })();
Advertisement
Add Comment
Please, Sign In to add comment