Commit 74a75ac5 authored by Sebastian Wiesner's avatar Sebastian Wiesner

Add unit tests for Go syntax checking

parent a2810a08
......@@ -24,4 +24,5 @@ Flycheck provides on-the-fly syntax checker with
(depends-on "cperl-mode")
(depends-on "php-mode")
(depends-on "php+-mode")
(depends-on "sass-mode"))
(depends-on "sass-mode")
(depends-on "go-mode"))
// A simple syntax error in Go
package main
func ta ta() {
\ No newline at end of file
;;; test-gofmt.el --- Test the gofmt checker -*- lexical-binding: t; -*-
;; Copyright (c) 2013 Sebastian Wiesner <>,
;; Author: Sebastian Wiesner <>,
;; URL:
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <>.
;;; Code:
(require 'ert)
(require 'flycheck)
(require 'go-mode nil :no-error)
(ert-deftest checker-go-gofmt-syntax-error ()
"Test a syntax error."
:expected-result (flycheck-fail-unless-checker 'go-gofmt)
(flycheck-with-resource-buffer "test-go/syntax-error.go"
'(5 9 "expected '(', found 'IDENT' ta" error)
'(6 1 "expected ')', found '}'" error))))
;; Local Variables:
;; coding: utf-8
;; End:
;;; test-gofmt.el ends here
......@@ -18,7 +18,9 @@
# Provision a VM with necessary packages to test all Flycheck checkers
ppa () {
sudo apt-add-repository -y "$1"
for ppa in "$@"; do
sudo apt-add-repository -y "$ppa"
apt_update () {
......@@ -56,9 +58,7 @@ apt_update
apt make python-software-properties
# Bring in the necessary PPAs
ppa ppa:cassou/emacs
ppa ppa:ondrej/php5
ppa ppa:richarvey/nodejs
ppa ppa:cassou/emacs ppa:ondrej/php5 ppa:richarvey/nodejs ppa:gophers/go
# Install texinfo to build documentation
......@@ -82,7 +82,8 @@ apt bash \
lua5.2 lua-mode \
chktex lacheck \
xmlstarlet \
zsh \
pip flake8 pylint pyflakes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment