Working through all the tooling examples.
Debugging
Use the new
dbg
instead of theIEx.pry
as shown to trigger a debug.You can only
break!
on public functions.You also can only
next
on public functions.Dave’s note is that he tends to raise an Exception to see what’s going on when he’s debugging.
Testing
I’ve been annoyed that VSCode’s does code hinting in comments. Now I see why, DocTest.
Adding DocTest to the TableFormatter caused me to change
print_header
andprint_separator
totable_header
andtable_separator
and print after call. Further promotes the ‘do one thing’ idiom and simplifies testing.I can see doing regular DocTests.
DocTests are good for demonstrating usage and do not replace UnitTests.
Added some fixtures to TableFormatter tests. Had been using
@values
.fixture
is just a name, could be anything, butfixture
is descriptive.setup
can declare a tuple or a function returning a tuple.Add an
on_exit
section to thesetup
block to do any cleanup.Will need to read ExUnitProperties and dig into examples.
Added ExCoveralls to
issues
project.
Code Dependencies
mix xref unreachable
mix xref warnings
mix xref callers [Module or function]
mix xref graph --format dot
dot -Grankdir=LR -Epenwidth=2 -Tpng -Ecolor=#a0a0a0 -o xref_graph.png xref_graph.dot
Server Monitoring
iex> :observer.start()
Source Code Formatting
I’m letting the IDE do the work.
mix format
All notes and comments are my own opinion. Follow me at @rgacote@genserver.social