src-highlite.git - src-highlite

index : src-highlite.git
src-highlite
summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat
-rw-r--r--THANKS 1
-rw-r--r--doc/index.html 1
-rw-r--r--src/Makefile.am 2
-rw-r--r--src/default.css 9
-rw-r--r--src/default.style 11
-rw-r--r--src/esc.style 11
-rw-r--r--src/esc256.style 9
-rw-r--r--src/feature.lang 26
-rw-r--r--src/lang.map 2
-rw-r--r--tests/Makefile.am 7
-rw-r--r--tests/default.style.html 11
-rw-r--r--tests/lang.list 1
-rw-r--r--tests/test.feature 39
-rw-r--r--tests/test.feature.html 44
14 files changed, 169 insertions, 5 deletions
diff --git a/THANKS b/THANKS
index 0b14268..d202947 100644
--- a/THANKS
+++ b/THANKS
@@ -117,6 +117,7 @@ Jean-Baptiste Rouquier
Jan Schafer
Bruno Schweizer
Ed Scott
+Jon Seidel
Konstantine Serebriany
Hemmi Shigeru
Mark Silberbauer
diff --git a/doc/index.html b/doc/index.html
index d2f10a8..4d02cf6 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -72,6 +72,7 @@ supported
<li> <i>Caml</i></li>
<li> <i>Changelog</i></li>
<li> <i>Css</i></li>
+<li> <i>Cucumber / feature</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
<li> <i>D</i></li>
<li> <i>Diff</i></li>
<li> <i>Emacs Lisp</i></li>
diff --git a/src/Makefile.am b/src/Makefile.am
index f537b45..7635e36 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -86,7 +86,7 @@ vbscript.lang awk.lang bat.lang clipper.lang cobol.lang d.lang \
errors.lang erlang.lang proto.lang vala.lang lisp.lang islisp.lang \
scheme.lang po.lang opa.lang javalog.lang upc.lang tml.lang \
lilypond.lang coffeescript.lang go.lang \
-r.lang s.lang zsh.lang groovy.lang json.lang
+r.lang s.lang zsh.lang groovy.lang json.lang feature.lang
LANGFILES_NOTTOCHECK= \
tml_formatting_all.lang tml_macrolinks.lang tml_macrosdelayed2.lang \
diff --git a/src/default.css b/src/default.css
index d58bfe8..8827256 100644
--- a/src/default.css
+++ b/src/default.css
@@ -53,3 +53,12 @@ body { background-color: white; }
/* for Oz */
.atom { color: orange; }
.meta { font-style: italic; }
+
+/* for feature/cucumber files */
+.cuketag { color: green; }
+.gherken { color: blue; }
+.given { color: red; }
+.when { color: cyan; }
+.then { color: yellow; }
+.and_but { color: pink; }
+.table { color: gray; } \ No newline at end of file
diff --git a/src/default.style b/src/default.style
index 24d7886..c0daf3d 100644
--- a/src/default.style
+++ b/src/default.style
@@ -69,4 +69,13 @@ label teal b;
// for errors
error purple;
-warning darkgreen; \ No newline at end of file
+warning darkgreen;
+
+// for feature (Cucumber) files
+cuketag green ;
+gherken blue ;
+given red ;
+when cyan ;
+then yellow ;
+and_but pink ;
+table gray ; \ No newline at end of file
diff --git a/src/esc.style b/src/esc.style
index c9451d9..626659b 100644
--- a/src/esc.style
+++ b/src/esc.style
@@ -32,4 +32,13 @@ difflines blue;
// for css
selector purple;
property blue;
-value darkgreen i; \ No newline at end of file
+value darkgreen i;
+
+// for feature (Cucumber) files
+cuketag green ;
+gherken blue ;
+given red ;
+when cyan ;
+then yellow ;
+and_but pink ;
+table white ;
diff --git a/src/esc256.style b/src/esc256.style
index 7b1b720..5cde492 100644
--- a/src/esc256.style
+++ b/src/esc256.style
@@ -40,3 +40,12 @@ value green ;
// specialchar
// symbol
// ====
+
+// for feature (Cucumber) files
+cuketag green ;
+gherken blue ;
+given red ;
+when cyan ;
+then yellow ;
+and_but pink ;
+table gray ;
diff --git a/src/feature.lang b/src/feature.lang
new file mode 100644
index 0000000..ff8ddf3
--- /dev/null
+++ b/src/feature.lang
@@ -0,0 +1,26 @@
+# Cucumber / feature file lang definition file
+# Probably can remove some definitions, since FFs are so simple
+
+include "number.lang"
+
+string delim "\"" "\"" escape "\\"
+string delim "'" "'" escape "\\"
+string delim "<" ">"
+
+keyword ="Feature|Background|Scenario|Scenario Outline|Examples"
+
+# type = '(\$[#]?|@@|@)([[:word:]]+|\'|\"|/)'
+
+include "script_comment.lang"
+
+# Define cucumber tables
+table = '^\s*\|([^|]*)\|([^|]*)\|\s*$'
+
+# tags
+cuketag = '(?<!\S)(@[[:word:]]+)(?!\S)'
+
+# The Gherken statements
+given = '^\s*(Given)'
+when = '^\s*(When)'
+then = '^\s*(Then)'
+and_but = '^\s*(And|But)'
diff --git a/src/lang.map b/src/lang.map
index d555c00..e84ded8 100644
--- a/src/lang.map
+++ b/src/lang.map
@@ -168,4 +168,4 @@ lilypond = lilypond.lang
ly = lilypond.lang
groovy = groovy.lang
json = json.lang
-
+feature = feature.lang
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b7774b6..b2accf1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -257,6 +257,7 @@ test.ps test.ps.html \
test.go test.go.html \
test.groovy test.groovy.html \
test.json test.json.html \
+test.feature test.feature.html \
$(WRONGFILES) \
$(WRONGFILESOUT) \
$(WRONGSTYLES) $(WRONGSTYLESOUT) \
@@ -429,6 +430,7 @@ check_ps \
check_go \
check_groovy \
check_json \
+check_feature \
check_docbook \
check_namedgroups \
check_slang \
@@ -988,6 +990,11 @@ check_json:
@echo expect no output from diff
$(DIFF) $(srcdir)/test.json.html test.json.out.html
+check_feature:
+ $(PROGNAME) -i $(srcdir)/test.feature -o test.feature.out.html
+ @echo expect no output from diff
+ $(DIFF) $(srcdir)/test.feature.html test.feature.out.html
+
check_lang:
$(LANG2HTML) -i $(top_srcdir)/src/log.lang -o log.lang.out.html
$(LANG2HTML) -i $(top_srcdir)/src/c.lang -o c.lang.out.html
diff --git a/tests/default.style.html b/tests/default.style.html
index c9a8eb1..2becbc5 100644
--- a/tests/default.style.html
+++ b/tests/default.style.html
@@ -73,4 +73,13 @@ http://www.gnu.org/software/src-highlite -->
<i><font color="#9A1900">// for errors</font></i>
<font color="#009900">error</font> <b><font color="#0000FF">purple</font></b><font color="#990000">;</font>
-<font color="#009900">warning</font> <b><font color="#0000FF">darkgreen</font></b><font color="#990000">;</font></tt></pre>
+<font color="#009900">warning</font> <b><font color="#0000FF">darkgreen</font></b><font color="#990000">;</font>
+
+<i><font color="#9A1900">// for feature (Cucumber) files</font></i>
+<font color="#009900">cuketag</font> <b><font color="#0000FF">green</font></b> <font color="#990000">;</font>
+<font color="#009900">gherken</font> <b><font color="#0000FF">blue</font></b> <font color="#990000">;</font>
+<font color="#009900">given</font> <b><font color="#0000FF">red</font></b> <font color="#990000">;</font>
+<font color="#009900">when</font> <b><font color="#0000FF">cyan</font></b> <font color="#990000">;</font>
+<font color="#009900">then</font> <b><font color="#0000FF">yellow</font></b> <font color="#990000">;</font>
+<font color="#009900">and_but</font> <b><font color="#0000FF">pink</font></b> <font color="#990000">;</font>
+<font color="#009900">table</font> <b><font color="#0000FF">gray</font></b> <font color="#990000">;</font></tt></pre>
diff --git a/tests/lang.list b/tests/lang.list
index c84d05f..5f2c632 100644
--- a/tests/lang.list
+++ b/tests/lang.list
@@ -47,6 +47,7 @@ errors = errors.lang
f = fortran.lang
f77 = fortran.lang
f90 = fortran.lang
+feature = feature.lang
fixed-fortran = fixed-fortran.lang
flex = flex.lang
fortran = fortran.lang
diff --git a/tests/test.feature b/tests/test.feature
new file mode 100644
index 0000000..5f23f5f
--- /dev/null
+++ b/tests/test.feature
@@ -0,0 +1,39 @@
+Feature: Accident Report Email notifications
+ In order to keep track of what's going on
+ As the incident manager
+ I want to receive emails when a significant event occurs
+
+ Background:
+ Given I perform HTTP authentication as a "user"
+ When I go to the homepage
+ Then I should see "WARNING! This site is restricted"
+
+ @active @testing @another
+ Scenario: Notification of a new Accident Report
+ Given a clear email queue
+ And I am on the new_accident_report page
+ Then I should see "New Accident Report"
+ # When I build a "accident_report" instance from FactoryGirl
+ And I create an accident report
+ | field | value |
+ | accident_date | 2013年01月20日 |
+ | accident_time | 10:00 |
+ | accident_location | Here and there |
+ | accident_description | I came, I saw, I hit him |
+ | drivers_name | Bilbo Baggins |
+ | drivers_license_no | N4445555 |
+ And I press "Create Accident report"
+ Then I should see "Accident report was successfully created"
+ But I should not see "Error"
+
+ Scenario Outline: Send notification emails
+ Given a clear email queue
+ When I create an email template with <message>
+ And I email <addressee>
+ Then "manager@biz.com" should receive an email
+ And they should see <message> in the email
+
+ Examples:
+ | addressee | message |
+ | j@s.com | Finished |
+ | b@j.com | All done! |
diff --git a/tests/test.feature.html b/tests/test.feature.html
new file mode 100644
index 0000000..dac8958
--- /dev/null
+++ b/tests/test.feature.html
@@ -0,0 +1,44 @@
+<!-- Generator: GNU source-highlight
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#0000FF">Feature</font></b>: Accident Report Email notifications
+ In order to keep track of what's going on
+ As the incident manager
+ I want to receive emails when a significant event occurs
+
+ <b><font color="#0000FF">Background</font></b>:
+<font color="#FF0000"> Given</font> I perform HTTP authentication as a <font color="#FF0000">"user"</font>
+<font color="#66FFFF"> When</font> I go to the homepage
+<font color="#FFCC00"> Then</font> I should see <font color="#FF0000">"WARNING! This site is restricted"</font>
+
+ <font color="#33CC00">@active</font> <font color="#33CC00">@testing</font> <font color="#33CC00">@another</font>
+ <b><font color="#0000FF">Scenario</font></b>: Notification of a new Accident Report
+<font color="#FF0000"> Given</font> a clear email queue
+<font color="#CC33CC"> And</font> I am on the new_accident_report page
+<font color="#FFCC00"> Then</font> I should see <font color="#FF0000">"New Accident Report"</font>
+ <i><font color="#9A1900"># When I build a "accident_report" instance from FactoryGirl</font></i>
+<font color="#CC33CC"> And</font> I create an accident report
+<font color="#808080"> | field | value |</font>
+<font color="#808080"> | accident_date | 2013年01月20日 |</font>
+<font color="#808080"> | accident_time | 10:00 |</font>
+<font color="#808080"> | accident_location | Here and there |</font>
+<font color="#808080"> | accident_description | I came, I saw, I hit him |</font>
+<font color="#808080"> | drivers_name | Bilbo Baggins |</font>
+<font color="#808080"> | drivers_license_no | N4445555 |</font>
+<font color="#CC33CC"> And</font> I press <font color="#FF0000">"Create Accident report"</font>
+<font color="#FFCC00"> Then</font> I should see <font color="#FF0000">"Accident report was successfully created"</font>
+<font color="#CC33CC"> But</font> I should not see <font color="#FF0000">"Error"</font>
+
+ <b><font color="#0000FF">Scenario</font></b> Outline: Send notification emails
+<font color="#FF0000"> Given</font> a clear email queue
+<font color="#66FFFF"> When</font> I create an email template with <font color="#FF0000">&lt;message&gt;</font>
+<font color="#CC33CC"> And</font> I email <font color="#FF0000">&lt;addressee&gt;</font>
+<font color="#FFCC00"> Then</font> <font color="#FF0000">"manager@biz.com"</font> should receive an email
+<font color="#CC33CC"> And</font> they should see <font color="#FF0000">&lt;message&gt;</font> in the email
+
+ <b><font color="#0000FF">Examples</font></b>:
+<font color="#808080"> | addressee | message |</font>
+<font color="#808080"> | j@s.com | Finished |</font>
+<font color="#808080"> | b@j.com | All done! |</font>
+</tt></pre>
generated by cgit v1.2.3 (git 2.25.1) at 2025年10月03日 19:55:10 +0000

AltStyle によって変換されたページ (->オリジナル) /