From 9d63573e4e697e362380bf85f7cc8f077a859cf2 Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Thu, 6 Jan 2011 23:23:29 +0100 Subject: [PATCH] Issue 30: Add a test script to watch performance --- tests/data/multiple-redirections.zsh | 1 + tests/data/nested-parentheses.zsh | 1 + tests/data/simple-command.zsh | 1 + tests/data/simple-redirection.zsh | 1 + tests/data/unknown-command.zsh | 1 + tests/data/zsh-syntax-highlighting.zsh | 1 + tests/tests.zsh | 16 ++++++++++++++++ 7 files changed, 22 insertions(+) create mode 100644 tests/data/multiple-redirections.zsh create mode 100644 tests/data/nested-parentheses.zsh create mode 100644 tests/data/simple-command.zsh create mode 100644 tests/data/simple-redirection.zsh create mode 100644 tests/data/unknown-command.zsh create mode 120000 tests/data/zsh-syntax-highlighting.zsh create mode 100755 tests/tests.zsh diff --git a/tests/data/multiple-redirections.zsh b/tests/data/multiple-redirections.zsh new file mode 100644 index 0000000..bc9f91d --- /dev/null +++ b/tests/data/multiple-redirections.zsh @@ -0,0 +1 @@ +ps aux | grep java | sort | uniq | tail | head diff --git a/tests/data/nested-parentheses.zsh b/tests/data/nested-parentheses.zsh new file mode 100644 index 0000000..4e0016d --- /dev/null +++ b/tests/data/nested-parentheses.zsh @@ -0,0 +1 @@ +echo $(echo ${(z)array}) diff --git a/tests/data/simple-command.zsh b/tests/data/simple-command.zsh new file mode 100644 index 0000000..9e2740c --- /dev/null +++ b/tests/data/simple-command.zsh @@ -0,0 +1 @@ +ls diff --git a/tests/data/simple-redirection.zsh b/tests/data/simple-redirection.zsh new file mode 100644 index 0000000..39899ac --- /dev/null +++ b/tests/data/simple-redirection.zsh @@ -0,0 +1 @@ +ps aux | grep java diff --git a/tests/data/unknown-command.zsh b/tests/data/unknown-command.zsh new file mode 100644 index 0000000..9e2740c --- /dev/null +++ b/tests/data/unknown-command.zsh @@ -0,0 +1 @@ +ls diff --git a/tests/data/zsh-syntax-highlighting.zsh b/tests/data/zsh-syntax-highlighting.zsh new file mode 120000 index 0000000..98e45a3 --- /dev/null +++ b/tests/data/zsh-syntax-highlighting.zsh @@ -0,0 +1 @@ +/home/nicoulaj/projects/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh \ No newline at end of file diff --git a/tests/tests.zsh b/tests/tests.zsh new file mode 100755 index 0000000..0438862 --- /dev/null +++ b/tests/tests.zsh @@ -0,0 +1,16 @@ +#!/usr/bin/env zsh +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et + +# Copyleft 2011 zsh-syntax-highlighting contributors +# http://github.com/nicoulaj/zsh-syntax-highlighting +# All wrongs reserved. + + +source $(dirname $0)/../zsh-syntax-highlighting.zsh + +TIMEFMT="%*Es" +for buffer in $(dirname $0)/data/*.zsh; do + echo -n "${buffer:t:r}: " + time (BUFFER="`cat $buffer`" &&_zsh_highlight-zle-buffer) +done