1
0
forked from Mirror/wren
Files
wren/test/language/class/attributes/attributes.wren
ruby a4ae905384 Introduce Attributes (#962)
* introduce Attributes for classes and methods
2021-04-08 21:30:09 -07:00

22 lines
802 B
Plaintext

// Test the basic states. Keys without a group
// go into a group with null as the key
#!key
class Attr {}
System.print(Attr.attributes != null) // expect: true
System.print(Attr.attributes.self != null) // expect: true
System.print(Attr.attributes.methods) // expect: null
var attr = Attr.attributes.self
var nullGroup = attr[null]
System.print(nullGroup != null) // expect: true
System.print(nullGroup.count) // expect: 1
System.print(nullGroup.containsKey("key")) // expect: true
var keyItems = nullGroup["key"]
System.print(keyItems != null) // expect: true
System.print(keyItems is List) // expect: true
System.print(keyItems.count) // expect: 1
System.print(keyItems[0]) // expect: null