Here is a method with typical executable comments.
> aString
"Answer whether the receiver sorts after aString.
The collation order is simple ascii (with case differences)."
" 'def' > 'abc' >>> true"
" 'def' > 'def' >>> false"
" 'abc' > 'def' >>> false"
^ (self compare: self with: aString) > 0
" 'def' > 'abc' >>> true" is an executable comment.
The idea is to have little examples that we can check by executable the first part 'def' > 'abc' and this part should return the second part here true.
Here is a method with typical executable comments.
" 'def' > 'abc' >>> true"
is an executable comment. The idea is to have little examples that we can check by executable the first part'def' > 'abc'
and this part should return the second part heretrue
.We need to add more of them to core classes.