Add test to expose a load-time issue

The issue manifests when sclang is compiled. Steps to reproduce in real
emacs config:
1. Install the package and compile it
2. Open a file with a `.sc` or `.scd` extension
3. Witness the error `(void-function sclang-make-buffer-name)`

Steps to reproduce with the test:
0. install [eldev](https://github.com/doublep/eldev#installation)
1. `eldev compile`
2. `eldev test`
This commit is contained in:
John Andrews 2021-08-09 11:57:27 -04:00
parent 225e810bdd
commit 14157663b0
5 changed files with 28 additions and 1 deletions

3
.gitignore vendored
View file

@ -1 +1,4 @@
.DS_Store .DS_Store
*.elc
.eldev
/el/sclang-autoloads.el

7
el/Eldev Normal file
View file

@ -0,0 +1,7 @@
; -*- mode: emacs-lisp; lexical-binding: t -*-
;; Uncomment some calls below as needed for your project.
;(eldev-use-package-archive 'gnu)
;(eldev-use-package-archive 'melpa)
(eldev-use-plugin 'autoloads)

View file

@ -1,5 +1,7 @@
;;; sclang.el --- IDE for working with the SuperCollider language ;;; sclang.el --- IDE for working with the SuperCollider language
;; copyright 2003 stefan kersten <steve@k-hornz.de> ;; Copyright 2003 stefan kersten <steve@k-hornz.de>
;; Version: 1.0.0
;; URL: https://github.com/supercollider/scel
;; ;;
;; This program is free software; you can redistribute it and/or ;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as ;; modify it under the terms of the GNU General Public License as
@ -16,6 +18,13 @@
;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
;; USA ;; USA
;;; Commentary:
;;
;; This package provides code for interfacing with sclang and scsynth.
;; In order to be useful you need to install SuperCollider and the
;; sc-el Quark. See the README or https://github.com/supercollider/scel
;; for more information.
;;; Code: ;;; Code:
(defgroup sclang nil (defgroup sclang nil
"IDE for working with the SuperCollider language." "IDE for working with the SuperCollider language."

1
el/test/fixtures/super-boring.scd vendored Normal file
View file

@ -0,0 +1 @@
{ WhiteNoise.ar(0.2!2); }.play;

View file

@ -0,0 +1,7 @@
;; -*- no-byte-compile: t; lexical-binding: t; -*-
;;; test/sclang-mode-test.el
(ert-deftest sclang-major-mode-init-test ()
"Loading a file with an scd extension should init sclang-mode"
(find-file "fixtures/super-boring.scd")
(should (eq 'sclang-mode major-mode)))