diff --git a/test/Makefile b/test/Makefile index f29d46ee09829..50b06f512c40e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -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 diff --git a/test/meta.jl b/test/meta.jl new file mode 100644 index 0000000000000..0958567bea071 --- /dev/null +++ b/test/meta.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index b4a901af28861..379f89e99a78e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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")