Sha256: 68523cea8358ebfe9d5ab71ac6e9f8f6d4a546d7e9f5cdec9e5afeb7f15631f7

Contents?: true

Size: 1.88 KB

Versions: 35

Compression:

Stored size: 1.88 KB

Contents

;; -*- emacs-lisp -*-
;; This program has to be run from the directory it is currently in and
;; the rdebug code has to be in the parent directory
(load-file "./elk-test.el")

;; FIXME? Should we use "require 'rdebug" here.
;; Would have to prepend . to load-path.
(setq load-path (cons ".." load-path))
(load-file "../rdebug-shortkey.el")

(deftest "rdebug-shortkey-mode-test"
  (let ((buf (generate-new-buffer "shortkey readwrite")))
    (with-current-buffer buf
      (setq buffer-read-only nil)
      ;; turning on short-key-mode make buffer read-only
      (rdebug-internal-short-key-mode 1)
      (assert-equal t buffer-read-only)

      ;; turning off short-key-mode should make buffer read-write again
      (rdebug-internal-short-key-mode -1)
      (assert-equal nil buffer-read-only)

      ;; --------------------
      ;; Check multiple "on": and "off:s".

      (rdebug-internal-short-key-mode 1)
      (assert-equal t buffer-read-only)

      (rdebug-internal-short-key-mode 1)
      (assert-equal t buffer-read-only)

      (rdebug-internal-short-key-mode 1)
      (assert-equal t buffer-read-only)

      (rdebug-internal-short-key-mode -1)
      (assert-equal nil buffer-read-only))

    (kill-buffer buf))

  (let ((buf (generate-new-buffer "shortkey readonly")))
    (with-current-buffer buf
      (setq buffer-read-only t)

      ;; turning on short-key-mode keep buffer read-only
      (rdebug-internal-short-key-mode 1)
      (assert-equal t buffer-read-only)

      ;; The buffer was originally in read-only mode, it should remain
      ;; there.
      (rdebug-internal-short-key-mode -1)
      (assert-equal t buffer-read-only))
    (kill-buffer buf)))

;; -------------------------------------------------------------------
;; Build and run the test suite.
;;

(build-suite "rdebug-suite"
	     "rdebug-shortkey-mode-test")
(run-elk-test "rdebug-suite"
              "test things in rdebug-shortkey.el")

Version data entries

35 entries across 34 versions & 5 rubygems

Version Path
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/debugger-1.6.8/emacs/test/test-shortkey.el
debugger-1.6.8 emacs/test/test-shortkey.el
debugger-1.6.7 emacs/test/test-shortkey.el
debugger-1.6.6 emacs/test/test-shortkey.el
debugger-1.6.5 emacs/test/test-shortkey.el
debugger-1.6.4 emacs/test/test-shortkey.el
debugger-1.6.3 emacs/test/test-shortkey.el
debugger-1.6.2 emacs/test/test-shortkey.el
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/debugger-1.6.1/emacs/test/test-shortkey.el
candlepin-api-0.4.0 bundle/ruby/gems/debugger-1.6.1/emacs/test/test-shortkey.el
debugger-1.6.1 emacs/test/test-shortkey.el
debugger-1.6.0 emacs/test/test-shortkey.el
debugger2-1.0.0.beta2 emacs/test/test-shortkey.el
debugger2-1.0.0.beta1 emacs/test/test-shortkey.el
debugger-1.5.0 emacs/test/test-shortkey.el
needy_debugger-1.4.0 emacs/test/test-shortkey.el
debugger-1.4.0 emacs/test/test-shortkey.el
debugger-1.3.3 emacs/test/test-shortkey.el
debugger-1.3.2 emacs/test/test-shortkey.el
debugger-1.3.1 emacs/test/test-shortkey.el