summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenil <dedaniahenil@gmail.com>2020-11-15 00:22:08 +0530
committerDavid Peter <sharkdp@users.noreply.github.com>2020-11-23 15:43:58 +0100
commit591eba66a3af1c211a09eefd17cbeb819b0a131f (patch)
treecf0b604f97314d567745498c85be1aec36e85f25
parenta5a9ac83e5a506ac2bdc673476aca54c818eabe2 (diff)
add new syntax test filesv0.17.0
-rw-r--r--tests/syntax-tests/highlighted/ASP/test.asp36
-rw-r--r--tests/syntax-tests/highlighted/AppleScript/test.applescript25
-rw-r--r--tests/syntax-tests/highlighted/Fish/test.fish77
-rw-r--r--tests/syntax-tests/highlighted/Objective-C++/test.mm68
-rw-r--r--tests/syntax-tests/highlighted/Objective-C/test.m32
-rw-r--r--tests/syntax-tests/highlighted/Regular Expression/test.re1
-rw-r--r--tests/syntax-tests/highlighted/Ruby On Rails/test.rb22
-rw-r--r--tests/syntax-tests/highlighted/Tcl/test.tcl22
-rw-r--r--tests/syntax-tests/highlighted/Textile/test.textile40
-rw-r--r--tests/syntax-tests/source/ASP/test.asp36
-rw-r--r--tests/syntax-tests/source/AppleScript/test.applescript25
-rw-r--r--tests/syntax-tests/source/Fish/test.fish77
-rw-r--r--tests/syntax-tests/source/Objective-C++/test.mm68
-rw-r--r--tests/syntax-tests/source/Objective-C/test.m32
-rw-r--r--tests/syntax-tests/source/Regular Expression/test.re1
-rw-r--r--tests/syntax-tests/source/Ruby On Rails/test.rb22
-rw-r--r--tests/syntax-tests/source/Tcl/test.tcl22
-rw-r--r--tests/syntax-tests/source/Textile/test.textile40
18 files changed, 646 insertions, 0 deletions
diff --git a/tests/syntax-tests/highlighted/ASP/test.asp b/tests/syntax-tests/highlighted/ASP/test.asp
new file mode 100644
index 00000000..db610895
--- /dev/null
+++ b/tests/syntax-tests/highlighted/ASP/test.asp
@@ -0,0 +1,36 @@
+<html>
+<body>
+<!-- #include file ="headers\header.inc" -->
+
+<%
+For i = 0 To 5
+Response.Write("The number is " & i & "<br />")
+Next
+%>
+
+<%
+Response.Write("Hello World!")
+%>
+
+<%
+Dim x(2,2)
+x(0,0)="Volvo"
+x(0,1)="BMW"
+x(0,2)="Ford"
+x(1,0)="Apple"
+x(1,1)="Orange"
+x(1,2)="Banana"
+x(2,0)="Coke"
+x(2,1)="Pepsi"
+x(2,2)="Sprite"
+for i=0 to 2
+response.write("<p>")
+for j=0 to 2
+response.write(x(i,j) & "<br />")
+next
+response.write("</p>")
+next
+%>
+
+</body>
+</html>
diff --git a/tests/syntax-tests/highlighted/AppleScript/test.applescript b/tests/syntax-tests/highlighted/AppleScript/test.applescript
new file mode 100644
index 00000000..f3692a84
--- /dev/null
+++ b/tests/syntax-tests/highlighted/AppleScript/test.applescript
@@ -0,0 +1,25 @@
+-- This is a comment
+
+property defaultClientName : "Mary Smith"
+
+on greetClient(nameOfClient)
+ display dialog ("Hello " & nameOfClient & "!")
+end greetClient
+
+
+script testGreet
+ greetClient(defaultClientName)
+end script
+
+run testGreet
+greetClient("Joe Jones")
+
+set myList to {1, "what", 3}
+set beginning of myList to 0
+set end of myList to "four"
+
+myList
+
+tell application "TextEdit"
+ paragraph 1 of document 1
+end tell
diff --git a/tests/syntax-tests/highlighted/Fish/test.fish b/tests/syntax-tests/highlighted/Fish/test.fish
new file mode 100644
index 00000000..3e7d8b86
--- /dev/null
+++ b/tests/syntax-tests/highlighted/Fish/test.fish
@@ -0,0 +1,77 @@
+set fish_greeting ""
+
+begin
+ set --local AUTOJUMP_PATH $XDG_CONFIG_HOME/fish/functions/autojump.fish
+ if test -e $AUTOJUMP_PATH
+ source $AUTOJUMP_PATH
+ end
+end
+
+fish_vi_key_bindings
+
+
+function fish_prompt
+ set_color brblack
+ echo -n "["(date "+%H:%M")"] "
+ set_color blue
+ echo -n (hostname)
+ if [ $PWD != $HOME ]
+ set_color brblack
+ echo -n ':'
+ set_color yellow
+ echo -n (basename $PWD)
+ end
+ set_color green
+ printf '%s ' (__fish_git_prompt)
+ set_color red
+ echo -n '| '
+ set_color normal
+end
+
+function fish_greeting
+ echo
+ echo -e (uname -ro | awk '{print " \\\\e[1mOS: \\\\e[0;32m"$0"\\\\e[0m"}')
+ echo -e (uptime -p | sed 's/^up //' | awk '{print " \\\\e[1mUptime: \\\\e[0;32m"$0"\\\\e[0m"}')
+ echo -e (uname -n | awk '{print " \\\\e[1mHostname: \\\\e[0;32m"$0"\\\\e[0m"}')
+ echo -e " \\e[1mDisk usage:\\e[0m"
+ echo
+ echo -ne (\
+ df -l -h | grep -E 'dev/(xvda|sd|mapper)' | \
+ awk '{printf "\\\\t%s\\\\t%4s / %4s %s\\\\n\n", $6, $3, $2, $5}' | \
+ sed -e 's/^\(.*\([8][5-9]\|[9][0-9]\)%.*\)$/\\\\e[0;31m\1\\\\e[0m/' -e 's/^\(.*\([7][5-9]\|[8][0-4]\)%.*\)$/\\\\e[0;33m\1\\\\e[0m/' | \
+ paste -sd ''\
+ )
+ echo
+
+ echo -e " \\e[1mNetwork:\\e[0m"
+ echo
+ # http://tdt.rocks/linux_network_interface_naming.html
+ echo -ne (\
+ ip addr show up scope global | \
+ grep -E ': <|inet' | \
+ sed \
+ -e 's/^[[:digit:]]\+: //' \
+ -e 's/: <.*//' \
+ -e 's/.*inet[[:digit:]]* //' \
+ -e 's/\/.*//'| \
+ awk 'BEGIN {i=""} /\.|:/ {print i" "$0"\\\n"; next} // {i = $0}' | \
+ sort | \
+ column -t -R1 | \
+ # public addresses are underlined for visibility \
+ sed 's/ \([^ ]\+\)$/ \\\e[4m\1/' | \
+ # private addresses are not \
+ sed 's/m\(\(10\.\|172\.\(1[6-9]\|2[0-9]\|3[01]\)\|192\.168\.\).*\)/m\\\e[24m\1/' | \
+ # unknown interfaces are cyan \
+ sed 's/^\( *[^ ]\+\)/\\\e[36m\1/' | \
+ # ethernet interfaces are normal \
+ sed 's/\(\(en\|em\|eth\)[^ ]* .*\)/\\\e[39m\1/' | \
+ # wireless interfaces are purple \
+ sed 's/\(wl[^ ]* .*\)/\\\e[35m\1/' | \
+ # wwan interfaces are yellow \
+ sed 's/\(ww[^ ]* .*\).*/\\\e[33m\1/' | \
+ sed 's/$/\\\e[0m/' | \
+ sed 's/^/\t/' \
+ )
+ echo
+ set_color normal
+end
diff --git a/tests/syntax-tests/highlighted/Objective-C++/test.mm b/tests/syntax-tests/highlighted/Objective-C++/test.mm
new file mode 100644
index 00000000..51989020
--- /dev/null
+++ b/tests/syntax-tests/highlighted/Objective-C++/test.mm
@@ -0,0 +1,68 @@
+#import <Foundation/Foundation.h>
+
+class Hello {
+ private:
+ id greeting_text;
+
+ public:
+ Hello() {
+ greeting_text = @"Hello, world!";
+ }
+
+ Hello(const char* initial_greeting_text) {
+ greeting_text = [[NSString alloc] initWithUTF8String:initial_greeting_text];
+ }
+
+ void say_hello() {
+ printf("%s\n", [greeting_text UTF8String]);
+ }
+};
+
+@interface Greeting : NSObject {
+ @private
+ Hello *hello;
+
+}
+- (id)init;
+- (void)dealloc;
+- (void)sayGreeting;
+- (void)sayGreeting:(Hello*)greeting;
+@end
+
+@implementation Greeting
+- (id)init {
+ self = [super init];
+ if (self) {
+ hello = new Hello();
+ }
+ return self;
+}
+
+- (void)dealloc {
+ delete hello;
+ [super dealloc];
+}
+
+- (void)sayGreeting {
+ hello->say_hello();
+}
+
+- (void)sayGreeting:(Hello*)greeting {
+ greeting->say_hello();
+}
+@end
+
+int main() {
+
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ Greeting *greeting = [[Greeting alloc] init];
+ [greeting sayGreeting];
+
+ Hello *hello = new Hello("Bonjour, monde!");
+ [greeting sayGreeting:hello];
+
+ delete hello;
+ [greeting release];
+ [pool release];
+ return 0;
+}
diff --git a/tests/syntax-tests/highlighted/Objective-C/test.m b/tests/syntax-tests/highlighted/Objective-C/test.m
new file mode 100644
index 00000000..287c7400
--- /dev/null
+++ b/tests/syntax-tests/highlighted/Objective-C/test.m
@@ -0,0 +1,32 @@
+#import <myClass.h>
+@import Foundation
+// Single line comments
+
+/*
+ * Multi line comment
+ */
+
+int main (int [3;38;2;