1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: fix eventbus_test.v

This commit is contained in:
Alexander Medvednikov 2020-05-01 10:57:05 +02:00
parent 666801f9f9
commit 51da324465
4 changed files with 13 additions and 3 deletions

View File

@ -7,7 +7,6 @@ import v.pref
const (
skip_test_files = [
'vlib/arrays/arrays_test.v',
'vlib/eventbus/eventbus_test.v',
'vlib/json/json_test.v',
'vlib/v/tests/enum_bitfield_test.v',
'vlib/v/tests/num_lit_call_method_test.v',

View File

@ -65,8 +65,10 @@ fn (pb mut Publisher) publish(name string, sender voidptr, args voidptr) {
if event.once {
pb.registry.events.delete(i)
}
if event.receiver != voidptr(0) {
event.handler(event.receiver, args, sender)
//
x := event.receiver
if x != 0 {
event.handler(x, args, sender)
} else {
event.handler(sender, args, voidptr(0))
}

View File

@ -9,6 +9,12 @@ import gx
import gg
import glm
import gl
/*
TODO
!!!!!!
Use a font atlas
!!!!!!
*/
#flag windows -I @VROOT/thirdparty/freetype/include
#flag windows -L @VROOT/thirdparty/freetype/win64

View File

@ -35,6 +35,9 @@ fn perform_speak(s Speaker) {
assert true
name := s.name()
assert name == 'Dog' || name == 'Cat'
//if s is Dog {
//assert name == 'Dog'
//}
println(s.name())
}