test: for attr

almost rewrote
examples: follow the current API