6.2 Lua Variables
Moving on to our Lua example.
1cd ~/lua 2busted
We should see the tests pass.
busted
1o 21 success / 0 failures / 0 errors / 0 pending : 0.002722 seconds
Now edit the Lua version of our program.
1vi bin/convert.lua
Change this program to the following.
bin/convert.lua
1greeting_message = "Hello World!" 2print(greeting_message)
This is identical to the Python version of our program but don’t worry we will see differences later. What this example shows is that different languages share many features, especially with these core coding ideas like variables.
Re-run the tests to confirm we have broken nothing.
1busted
busted
1o 21 success / 0 failures / 0 errors / 0 pending : 0.002722 seconds