vim-jp / vital.vim

A comprehensive Vim utility functions for Vim plugins
574 stars 64 forks source link

DateTime specs are failing #291

Open ujihisa opened 9 years ago

ujihisa commented 9 years ago

前にgist貼ってたやつです。travisでは環境設定でうまくいっているので、ローカル開発環境でもそんな感じでアレできると便利そうです。

$ themis --runtimepath ~/.vimbundles/vimproc --reporter dot
.....................................................................................................................................................................................................................................................F...............F..F...............FFFFFF...................................FFFF...............FF..........................................................................................................................P......................................................................................................................

Pending:
  1) Text.Sexp parse
     Vital.Text.Sexp: any function call needs if_lua

Failures:
  1) Data.OrderedSet Fn_identifier stringifies to a key name of a Dictionary
     Error occurred line:
       3:       Assert Equals(set.to_list(), [   CreateClass('FooClass', 'foo'),   CreateClass('BarClass', 'bar'),   CreateClass('BazClass', 'baz'),   CreateClass('FooClass', 'hoge'),])
     The equivalent values were expected, but it was not the case.

         expected: [{'name': 'FooClass', 'mem1': 1428853136, 'mem2': 1428853136, 'mem3': 1428853136, 'value': 'foo'}, {'name': 'BarClass', 'mem1': 1428853136, 'mem2': 1428853136, 'mem3': 1428853136, 'value': 'bar'}, {'name': 'BazClass', 'mem1': 1428853136, 'mem2': 1428853136, 'mem3': 1428853136, 'value': 'baz'}, {'name': 'FooClass', 'mem1': 1428853136, 'mem2': 1428853136, 'mem3': 1428853136, 'value': 'hoge'}]
              got: [{'name': 'FooClass', 'mem1': 1428853135, 'mem2': 1428853135, 'mem3': 1428853135, 'value': 'foo'}, {'name': 'BarClass', 'mem1': 1428853135, 'mem2': 1428853135, 'mem3': 1428853135, 'value': 'bar'}, {'name': 'BazClass', 'mem1': 1428853135, 'mem2': 1428853135, 'mem3': 1428853135, 'value': 'baz'}, {'name': 'FooClass', 'mem1': 1428853135, 'mem2': 1428853135, 'mem3': 1428853135, 'value': 'hoge'}]

  2) DateTime .from_unix_time() makes a DateTime object from unix time
     Error occurred line:
       2:       Assert Equals(dt.to_string(), '2012-01-02 03:04:05 +0900')
     The equivalent values were expected, but it was not the case.

         expected: '2012-01-02 03:04:05 +0900'
              got: '2012-01-02 02:04:05 +0900'

  3) DateTime .from_format() can treat the some format specifier
     Error occurred line:
       3:       Assert Equals(dt.month(), 1)
     The equivalent values were expected, but it was not the case.

         expected: 1
              got: 2

  4) DateTime .month_names() with {longname} is 0 returns the list of name of months
     Error occurred line:
       2:         Assert Equals(names, ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])
     The equivalent values were expected, but it was not the case.

         expected: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
              got: ['Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov']

  5) DateTime .month_names() with {longname} is 1 returns the list of long name of months
     Error occurred line:
       2:         Assert Equals(names, ['January', 'February', 'March', 'April', 'May', 'June',  'July', 'August', 'September', 'October', 'November', 'December'])
     The equivalent values were expected, but it was not the case.

         expected: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
              got: ['December', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November']

  6) DateTime .weekday_names() with {longname} is 0 returns the list of name of weekdays
     Error occurred line:
       2:         Assert Equals(names, ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'])
     The equivalent values were expected, but it was not the case.

         expected: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
              got: ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri']

  7) DateTime .weekday_names() with {longname} is 1 returns the list of long name of weekdays
     Error occurred line:
       2:         Assert Equals(names, ['Sunday', 'Monday', 'Tuesday',   'Wednesday', 'Thursday', 'Friday', 'Saturday'])
     The equivalent values were expected, but it was not the case.

         expected: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
              got: ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']

  8) DateTime .am_pm_names() {lowercase} = 0 returns the list of am/pm names in uppercase
     Error occurred line:
       2:         Assert Equals(names, ['AM', 'PM'])
     The equivalent values were expected, but it was not the case.

         expected: ['AM', 'PM']
              got: ['PM', 'AM']

  9) DateTime .am_pm_names() {lowercase} is 1 returns the list of am/pm names in lowercase
     Error occurred line:
       2:         Assert Equals(names, ['am', 'pm'])
     The equivalent values were expected, but it was not the case.

         expected: ['am', 'pm']
              got: ['pm', 'am']

 10) DateTime DateTime object .format() symbol "%a" is the abbreviated weekday name
     Error occurred line:
       1:           Assert Equals(dt.format('%a', 'C'), 'Mon')
     The equivalent values were expected, but it was not the case.

         expected: 'Mon'
              got: 'Sun'

 11) DateTime DateTime object .format() symbol "%A" is the full weekday name
     Error occurred line:
       1:           Assert Equals(dt.format('%A', 'C'), 'Monday')
     The equivalent values were expected, but it was not the case.

         expected: 'Monday'
              got: 'Sunday'

 12) DateTime DateTime object .format() symbol "%b" is the abbreviated month name
     Error occurred line:
       1:           Assert Equals(dt.format('%b', 'C'), 'Jan')
     The equivalent values were expected, but it was not the case.

         expected: 'Jan'
              got: 'Dec'

 13) DateTime DateTime object .format() symbol "%B" is the full month name
     Error occurred line:
       1:           Assert Equals(dt.format('%B', 'C'), 'January')
     The equivalent values were expected, but it was not the case.

         expected: 'January'
              got: 'December'

 14) DateTime DateTime object .format() symbol "%p" is either "AM" or "PM" according to the given time value
     Error occurred line:
       1:           Assert Equals(dt.format('%p', 'C'), 'AM')
     The equivalent values were expected, but it was not the case.

         expected: 'AM'
              got: 'PM'

 15) DateTime DateTime object .format() symbol "%P" is either "am" or "pm" according to the given time value
     Error occurred line:
       1:           Assert Equals(dt.format('%P', 'C'), 'am')
     The equivalent values were expected, but it was not the case.

         expected: 'am'
              got: 'pm'

tests 583
passes 567
pendings 1
fails 15
vimshell: exit 1 "themis --runtimepath /home/ujihisa/.vimbundles/vimproc --reporter dot"
ujihisa commented 9 years ago

(って見たら前は通ってたData.OrderedSetも落ちてるw DateTimeと関係ないけどw)

thinca commented 9 years ago

環境教えてください。

ujihisa commented 9 years ago
~/Dropbox/vimbundles/neochat.vim
$ uname -a
Linux zenbook 3.18.0-gentoo #1 SMP Tue Dec 9 18:15:31 PST 2014 x86_64 Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz GenuineIntel GNU/Linux
~/Dropbox/vimbundles/neochat.vim
$ :version

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 13 2014 19:35:37)
Included patches: 1-542
Modified by Gentoo-7.4.542
Compiled by ujihisa@zenbook
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             +comments        +ex_extra        +jumplist        +mouseshape      +path_extra      +signs           +textobjects     +writebackup
+arabic          +conceal         +extra_search    +keymap          +mouse_dec       +perl            +smartindent     +title           +X11
+autocmd         +cryptv          +farsi           +langmap         -mouse_gpm       +persistent_undo -sniff           +toolbar         -xfontset
+balloon_eval    -cscope          +file_in_path    +libcall         -mouse_jsbterm   +postscript      +startuptime     +user_commands   +xim
+browse          +cursorbind      +find_in_path    +linebreak       +mouse_netterm   +printer         +statusline      +vertsplit       +xsmp_interact
++builtin_terms  +cursorshape     +float           +lispindent      +mouse_sgr       +profile         -sun_workshop    +virtualedit     +xterm_clipboard
+byte_offset     +dialog_con_gui  +folding         +listcmds        -mouse_sysmouse  +python          +syntax          +visual          -xterm_save
+cindent         +diff            -footer          +localmap        +mouse_urxvt     -python3         +tag_binary      +visualextra     +xpm
+clientserver    +digraphs        +fork()          +lua             +mouse_xterm     +quickfix        +tag_old_static  +viminfo         
+clipboard       +dnd             +gettext         +menu            +multi_byte      +reltime         -tag_any_white   +vreplace        
+cmdline_compl   -ebcdic          -hangul_input    +mksession       +multi_lang      +rightleft       -tcl             +wildignore      
+cmdline_hist    +emacs_tags      +iconv           +modify_fname    -mzscheme        -ruby            +terminfo        +wildmenu        
+cmdline_info    +eval            +insert_expand   +mouse           -netbeans_intg   +scrollbind      +termresponse    +windows         
   system vimrc file: "/etc/vim/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/vim/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: x86_64-pc-linux-gnu-gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2    -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: x86_64-pc-linux-gnu-gcc   -Wl,-E  -Wl,-O1 -Wl,--as-needed -o gvim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype  -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -lncurses -lelf   -lacl -lattr -ldl  -L/usr/lib -lluajit-5.1 -Wl,-E -Wl,-O1 -Wl,--as-needed  -L/usr/lib64/perl5/5.20.1/x86_64-linux/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lc -L/usr/lib64/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic      
$ echo $LANG
en_US.UTF-8
$ date +%Z
PDT
crazymaster commented 9 years ago

https://travis-ci.org/vim-jp/vital.vim/jobs/80370565#L6 Travis CI は UTC ですね。

$ date +%Z PDT

となっていますが、helpによると

https://github.com/vim-jp/vital.vim/blob/f82f14fd1b5946dccb02dfded1ed636a41e55e18/doc/vital-date_time.txt#L27

  • Doesn't treat DST(summer time).

こんな項目が...

thinca commented 9 years ago

DateTime 周りのバグをいくつか直したので、もう一度試してもらって良いですか?

lambdalisue commented 8 years ago

Ping @ujihisa

ujihisa commented 8 years ago
$ themis --runtimepath ~/.vimbundles/vimproc --reporter dot test/DateTime.vimspec
...F...............FFFFFF....................................FFFF...............FF.........................................

Failures:
  1) DateTime .from_format() can treat the some format specifier
     Error occurred line:
       3:       Assert Equals(dt.month(), 1)
     The equivalent values were expected, but it was not the case.

         expected: 1
              got: 2

  2) DateTime .month_names() with {longname} is 0 returns the list of name of months
     Error occurred line:
       2:         Assert Equals(names, ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])
     The equivalent values were expected, but it was not the case.

         expected: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
              got: ['Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov']

  3) DateTime .month_names() with {longname} is 1 returns the list of long name of months
     Error occurred line:
       2:         Assert Equals(names, ['January', 'February', 'March', 'April', 'May', 'June',  'July', 'August', 'September', 'October', 'November', 'December'])
     The equivalent values were expected, but it was not the case.

         expected: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
              got: ['December', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November']

  4) DateTime .weekday_names() with {longname} is 0 returns the list of name of weekdays
     Error occurred line:
       2:         Assert Equals(names, ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'])
     The equivalent values were expected, but it was not the case.

         expected: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
              got: ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri']

  5) DateTime .weekday_names() with {longname} is 1 returns the list of long name of weekdays
     Error occurred line:
       2:         Assert Equals(names, ['Sunday', 'Monday', 'Tuesday',   'Wednesday', 'Thursday', 'Friday', 'Saturday'])
     The equivalent values were expected, but it was not the case.

         expected: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
              got: ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']

  6) DateTime .am_pm_names() {lowercase} is 0 returns the list of am/pm names in uppercase
     Error occurred line:
       2:         Assert Equals(names, ['AM', 'PM'])
     The equivalent values were expected, but it was not the case.

         expected: ['AM', 'PM']
              got: ['PM', 'AM']

  7) DateTime .am_pm_names() {lowercase} is 1 returns the list of am/pm names in lowercase
     Error occurred line:
       2:         Assert Equals(names, ['am', 'pm'])
     The equivalent values were expected, but it was not the case.

         expected: ['am', 'pm']
              got: ['pm', 'am']

  8) DateTime DateTime object .format() symbol "%a" is the abbreviated weekday name
     Error occurred line:
       1:           Assert Equals(dt.format('%a', 'C'), 'Mon')
     The equivalent values were expected, but it was not the case.

         expected: 'Mon'
              got: 'Sun'

  9) DateTime DateTime object .format() symbol "%A" is the full weekday name
     Error occurred line:
       1:           Assert Equals(dt.format('%A', 'C'), 'Monday')
     The equivalent values were expected, but it was not the case.

         expected: 'Monday'
              got: 'Sunday'

 10) DateTime DateTime object .format() symbol "%b" is the abbreviated month name
     Error occurred line:
       1:           Assert Equals(dt.format('%b', 'C'), 'Jan')
     The equivalent values were expected, but it was not the case.

         expected: 'Jan'
              got: 'Dec'

 11) DateTime DateTime object .format() symbol "%B" is the full month name
     Error occurred line:
       1:           Assert Equals(dt.format('%B', 'C'), 'January')
     The equivalent values were expected, but it was not the case.

         expected: 'January'
              got: 'December'

 12) DateTime DateTime object .format() symbol "%p" is either "AM" or "PM" according to the given time value
     Error occurred line:
       1:           Assert Equals(dt.format('%p', 'C'), 'AM')
     The equivalent values were expected, but it was not the case.

         expected: 'AM'
              got: 'PM'

 13) DateTime DateTime object .format() symbol "%P" is either "am" or "pm" according to the given time value
     Error occurred line:
       1:           Assert Equals(dt.format('%P', 'C'), 'am')
     The equivalent values were expected, but it was not the case.

         expected: 'am'
              got: 'pm'

tests 123
passes 110
fails 13
vimshell: exit 1 "themis --runtimepath /home/ujihisa/.vimbundles/vimproc --reporter dot test/DateTime.vimspec"

ちなみにもうDSTではなくて普通のPSTなうです。