## Process this file with automake to produce Makefile.in.
##
## Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-## 2011, 2012 Free Software Foundation, Inc.
+## 2011, 2012, 2013 Free Software Foundation, Inc.
##
## This file is part of GUILE.
##
EXTRA_DIST =
TESTS_ENVIRONMENT = \
+ top_srcdir="$(top_srcdir)" \
srcdir="$(srcdir)" \
builddir="$(builddir)" \
@LOCALCHARSET_TESTS_ENVIRONMENT@ \
check_SCRIPTS += test-command-line-encoding2
TESTS += test-command-line-encoding2
+check_SCRIPTS += test-language
+TESTS += test-language
+EXTRA_DIST += test-language.el test-language.js
+
# test-num2integral
test_num2integral_SOURCES = test-num2integral.c
test_num2integral_CFLAGS = ${test_cflags}
--- /dev/null
+#!/bin/sh
+
+set -e
+
+# Make sure that code passed as `-c' or `-l' is evaluted using the
+# right language.
+
+# The default language in effect until `--language' is encountered is
+# Scheme.
+guile -c "(exit (= 3 (apply + '(1 2))))" --language=elisp
+! guile -c "(= (funcall (symbol-function '+) 1 2) 3)" 2> /dev/null
+
+guile --language=elisp -c "(= (funcall (symbol-function '+) 1 2) 3)"
+guile --language=ecmascript -c '(function (x) { return x * x; })(2);'
+
+# Same with `-l'.
+guile --no-auto-compile -l "$top_srcdir/module/ice-9/q.scm" -c 1
+guile --no-auto-compile \
+ -l "$top_srcdir/module/ice-9/q.scm" \
+ --language=elisp \
+ -l "$srcdir/test-language.el" \
+ --language=ecmascript \
+ -l "$srcdir/test-language.js" \
+ --language=scheme \
+ -c 1
--- /dev/null
+/* Sample ECMAscript code for `test-language'. */
+
+function fib (n)
+{
+ if (n <= 1)
+ return n;
+ else
+ return fib (n - 1) + fib (n - 2);
+}
+
+if (fib (7) != 13)
+ error ("Something's wrong!");