Julia samples (#108)
* Add julialang binary search sample * Add unit test * Add julialang selection sort sample * Change julia suffix to jl * Add recursion and quick sort with tests * add quick sort * Add hash table samples * Add BFS * Changed file names * Add dijkstras * Add Dijkstras test
This commit is contained in:
committed by
Aditya Bhargava
parent
30bbe9cf01
commit
9dc7611411
24
03_recursion/julia/02_greet.jl
Normal file
24
03_recursion/julia/02_greet.jl
Normal file
@@ -0,0 +1,24 @@
|
||||
using Test
|
||||
using Suppressor
|
||||
|
||||
function greet2(name)
|
||||
println("how are you, ",name,"?")
|
||||
end
|
||||
|
||||
function bye()
|
||||
println("ok bye!")
|
||||
end
|
||||
|
||||
function greet(name)
|
||||
println("hello, ",name,"!")
|
||||
greet2(name)
|
||||
println("getting ready to say bye...")
|
||||
bye()
|
||||
end
|
||||
|
||||
result = @capture_out greet("adit")
|
||||
@test result == "hello, adit!
|
||||
how are you, adit?
|
||||
getting ready to say bye...
|
||||
ok bye!
|
||||
"
|
||||
Reference in New Issue
Block a user