Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Sep 20, 2014
1 parent 67b58f2 commit 106e4f7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TESTS = all core keywordargs numbers strings unicode collections hashing \
suitesparse complex version pollfd mpfr broadcast socket floatapprox \
priorityqueue readdlm reflection regex float16 combinatorics dates \
sysinfo rounding ranges mod2pi euler show lineedit replcompletions \
backtrace repl test examples goto llvmcall grisu
backtrace repl test examples goto llvmcall grisu meta

default: all

Expand Down
27 changes: 27 additions & 0 deletions test/meta.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# test meta-expressions that annotate blocks of code

module MetaTest

using Base.Test

function f(x)
y = x+5
z = y*y
q = z/y
m = q-3
end

@inline function f_inlined(x)
y = x+5
z = y*y
q = z/y
m = q-3
end

g(x) = f(2x)
g_inlined(x) = f_inlined(2x)

@test g(3) == g_inlined(3)
@test f(3) == f_inlined(3)

end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ testnames = [
"floatapprox", "readdlm", "reflection", "regex", "float16", "combinatorics",
"sysinfo", "rounding", "ranges", "mod2pi", "euler", "show",
"lineedit", "replcompletions", "repl", "test", "examples", "goto",
"llvmcall", "grisu", "nullable"
"llvmcall", "grisu", "nullable", "meta"
]
@unix_only push!(testnames, "unicode")

Expand Down

0 comments on commit 106e4f7

Please sign in to comment.