,at the end when you add this in the middle of
aliases()should return the
mix ecto.setupthe three tasks
ecto.seedwill run one after the other.
bytecodein a memory. You access the documentation with the help of
Code.get_docs/2function . This means, the documentation accessed when it is required, but not when it is loaded in the virtual machine like
test.exwith the following code. You can copy and paste it.
nilwhen you are trying to access the docs of the module you have created so far. This is because, the
bytecodeis not available in disk. In simple way
beamfile is not present. Lets do that...
Ctrl+Ctwice so you will come out of the shell and this time you run the command as
Elixir.Test.beam. Now the
bytecodefor the module
Testis available in memory. Now you can access the documentation as follows...
mix testit will run all the tests defined and gives you the time of testing. However, you can see more verbose output like which test you are running with the
--traceoption like following…
test_stringis the name of the test.
98hence it is listing out them as
char_list. However you can tell the
IO.inspectto list them as list itself with option
h Inspect.Opts, you will see that Elixir does this kind of thing with other values as well, specifically structs and binaries.
pidfunction. This comes with two flavors.
pid = #PID<0.21.32>because
#is considered as comment here.
#PID<0.21.32>is treated as comment.
String.replacefunction will replace the given the pattern with replacing pattern. By default, it replaces all the occurrences of the pattern. Lets check that…
String.replace str, "@", "#"is same as
String.replace str, "@", "#", global: true
global: false. So, it replaces only the first occurrence of
@. Lets check that…
@is replaced with
:erlang.memory :atomto get the memory usage of atoms.