Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Sep 11, 2014
1 parent 740b914 commit 7f7d9de
Show file tree
Hide file tree
Showing 3 changed files with 25 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
23 changes: 23 additions & 0 deletions test/meta.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# test meta-expressions that annotate blocks of code

let
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"
"llvmcall", "grisu", "meta"
]
@unix_only push!(testnames, "unicode")

Expand Down

0 comments on commit 7f7d9de

Please sign in to comment.