Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Yusuke Endoh
    @mame
    I, [2019-07-02T14:03:25.047487 #25130]  INFO -- :   1) Failure:
    I, [2019-07-02T14:03:25.047528 #25130]  INFO -- : TestLogPeriod#test_next_rotate_time [/tmp/ruby/v2/src/trunk-vm-asserts/test/logger/test_logperiod.rb:13]:
    I, [2019-07-02T14:03:25.047563 #25130]  INFO -- : <2019-07-19 00:00:00 +0100> expected but was
    I, [2019-07-02T14:03:25.047597 #25130]  INFO -- : <2019-07-19 00:00:00 +0000>.
    I, [2019-07-02T14:03:25.047629 #25130]  INFO -- : 
    I, [2019-07-02T14:03:25.047665 #25130]  INFO -- :   2) Failure:
    I, [2019-07-02T14:03:25.047698 #25130]  INFO -- : TestLogPeriod#test_next_rotate_time_extreme_cases [/tmp/ruby/v2/src/trunk-vm-asserts/test/logger/test_logperiod.rb:33]:
    I, [2019-07-02T14:03:25.047732 #25130]  INFO -- : <2018-07-02 00:00:00 +0100> expected but was
    I, [2019-07-02T14:03:25.047764 #25130]  INFO -- : <2018-07-02 00:00:00 +0000>.
    I, [2019-07-02T14:03:25.047795 #25130]  INFO -- : 
    I, [2019-07-02T14:03:25.047828 #25130]  INFO -- :   3) Failure:
    I, [2019-07-02T14:03:25.047860 #25130]  INFO -- : TestLogPeriod#test_previous_period_end [/tmp/ruby/v2/src/trunk-vm-asserts/test/logger/test_logperiod.rb:52]:
    I, [2019-07-02T14:03:25.047894 #25130]  INFO -- : <2019-07-17 23:59:59 +0100> expected but was
    I, [2019-07-02T14:03:25.047926 #25130]  INFO -- : <2019-07-17 23:59:59 +0000>.
    I, [2019-07-02T14:03:25.047957 #25130]  INFO -- : 
    I, [2019-07-02T14:03:25.047990 #25130]  INFO -- :   4) Failure:
    I, [2019-07-02T14:03:25.048023 #25130]  INFO -- : TestLogPeriod#test_previous_period_end_extreme_cases [/tmp/ruby/v2/src/trunk-vm-asserts/test/logger/test_logperiod.rb:72]:
    I, [2019-07-02T14:03:25.048055 #25130]  INFO -- : <2018-06-30 23:59:59 +0100> expected but was
    I, [2019-07-02T14:03:25.048107 #25130]  INFO -- : <2018-06-30 23:59:59 +0000>.
    Anton Davydov
    @davydovanton
    @mame I checked it , it's not dead code (TestLogDevice#test_shifting_dst_change failed without it). Will check what happened with CI now
    oh, I think it's timezone issue. Will fix it now, sorry
    Yusuke Endoh
    @mame
    Umm, the test passes on my laptop
    Ollie Haydon-Mulligan
    @ollieh-m

    Hi. We're trying to convert an unsigned integer into a string with a specified base, within rb_str_enumerate_codepoints, like this:

    c = rb_enc_codepoint_len(ptr, end, &n, enc);
    hex = rb_int2str(c, base);

    where the types are:

    unsigned int c;
    VALUE hex;

    But the strings we get back are not right... Any idea what we're getting wrong? How can we use rb_int2str (or is there another function we should use)?...

    Thank you :smile:

    Yusuke Endoh
    @mame
    Could you please show your expected result and actual one?
    Ah I see
    The variable c is C's unsigned int, and the first argument of rb_int2str is VALUE, so you need to convert its type
    You may want to use UINT2NUM(c)
    Ollie Haydon-Mulligan
    @ollieh-m
    Thank you. We are using UINT2NUM(c) :thumbsup: . We just realised the error was with the base being passed through. We thought it was 16, but it wasn't. Doh!
    Anton Davydov
    @davydovanton

    @mame I created a issue about timezones in ruby bug tracker
    https://bugs.ruby-lang.org/issues/15977

    thanks for your help!

    Yusuke Endoh
    @mame
    :+1:
    Ollie Haydon-Mulligan
    @ollieh-m
    @aqeelvn and I made a PR to extend String#codepoints ruby/ruby#2270
    Yusuke Endoh
    @mame
    @chrisseaton @tenderlove I've tested #2264 but it dumped core
    [ 8943/20830] TestGCCompact#test_complex_hash_keys/home/mame/work/ruby/test/ruby/test_gc_compact.rb:130: [BUG] rb_gc_mark(): 0x000055f6dc0e5ff0 is T_MOVED
    ruby 2.7.0dev (2019-07-02T15:36:31Z master 07a6428aaa) [x86_64-linux]
    
    -- Control frame information -----------------------------------------------
    c:0027 p:---- s:0161 e:000160 CFUNC  :verify_compaction_references
    c:0026 p:0025 s:0156 e:000155 METHOD /home/mame/work/ruby/test/ruby/test_gc_compact.rb:130
    /home/mame/work/ruby/test/ruby/test_gc_compact.rb:130: [BUG] Segmentation fault at 0x0000000000000000
    ruby 2.7.0dev (2019-07-02T15:36:31Z master 07a6428aaa) [x86_64-linux]
    
    -- Control frame information -----------------------------------------------
    c:0027 p:---- s:0161 e:000160 CFUNC  :verify_compaction_references
    c:0026 p:0025 s:0156 e:000155 METHOD /home/mame/work/ruby/test/ruby/test_gc_compact.rb:130
    make: *** [uncommon.mk:767: yes-test-all] Segmentation fault (コアダンプしました)
    I guess it is not due to the change itself, but it triggered the existing bug of GC compaction :smiling_imp:
    Stefan Magnuson
    @styrmis_twitter
    I've just published the post on pattern matching, will add some more examples in due course: https://stefan.magnuson.co/posts/2019-07-02-initial-thoughts-on-ruby-pattern-matching/
    Yusuke Endoh
    @mame
    :+1: :+1: :+1:
    nitpick: , ** is not needed
    because a hash pattern matches if all the specified keys exist

    For example

    case { a: 1, b: 2, c: 3 }
    in { a: }
    end

    does match

    Stefan Magnuson
    @styrmis_twitter
    Ah yes, thanks for pointing this out! Later I read that array matches must be exact, but hash matches
    just need a subset match
    Lewis Buckley
    @lewispb
    Thanks everyone for yesterday.. really enjoyed it :)
    Koichi Sasada
    @ko1
    Thank you for attending all!
    Sebastian Sogamoso
    @sebasoga
    just published the blog post I presented yesteday https://sourcediving.com/less-known-changes-in-ruby-2-7-8d5db660370f
    had a lot of fun yesterday! Thank you everyone