Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inline macro via :meta expressions #8297

Merged
merged 3 commits into from
Sep 20, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add tests
  • Loading branch information
timholy committed Sep 20, 2014
commit 106e4f71847df094b1463fd0d86ad827083942d4
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