summaryrefslogtreecommitdiff
path: root/tests/lexers/bash/example.txt
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-01-18 21:24:00 +0100
committerGeorg Brandl <georg@python.org>2021-01-18 22:08:36 +0100
commit2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch)
tree809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/bash/example.txt
parentf0445be718da83541ea3401aad882f3937147263 (diff)
downloadpygments-git-examplefiles.tar.gz
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/bash/example.txt')
-rw-r--r--tests/lexers/bash/example.txt153
1 files changed, 153 insertions, 0 deletions
diff --git a/tests/lexers/bash/example.txt b/tests/lexers/bash/example.txt
new file mode 100644
index 00000000..ccaaf1ab
--- /dev/null
+++ b/tests/lexers/bash/example.txt
@@ -0,0 +1,153 @@
+---input---
+#!/bin/bash
+
+printf "%d %s\n" 10 "foo"
+printf "%d %s\n" $((10#1)) "bar"
+
+let "m = 10#${1:1:2}"
+echo $m
+
+m=$((10#${1:4:3} + 10#${1:1:3}))
+echo $m
+
+m=$((10#${1:4:3}))
+echo $m
+
+m=$((10#$1))
+echo $m
+
+m=$((10#1))
+echo $m
+
+m=$((10))
+echo $m
+
+---tokens---
+'#!/bin/bash\n' Comment.Hashbang
+
+'\n' Text
+
+'printf' Name.Builtin
+' ' Text
+'"%d %s\\n"' Literal.String.Double
+' ' Text
+'10' Literal.Number
+' ' Text
+'"foo"' Literal.String.Double
+'\n' Text
+
+'printf' Name.Builtin
+' ' Text
+'"%d %s\\n"' Literal.String.Double
+' ' Text
+'$((' Keyword
+'10#1' Literal.Number
+'))' Keyword
+' ' Text
+'"bar"' Literal.String.Double
+'\n\n' Text
+
+'let' Name.Builtin
+' ' Text
+'"' Literal.String.Double
+'m = 10#' Literal.String.Double
+'${' Literal.String.Interpol
+'1' Name.Variable
+':' Punctuation
+'1' Name.Variable
+':' Punctuation
+'2' Name.Variable
+'}' Literal.String.Interpol
+'"' Literal.String.Double
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10#' Literal.Number
+'${' Literal.String.Interpol
+'1' Name.Variable
+':' Punctuation
+'4' Name.Variable
+':' Punctuation
+'3' Name.Variable
+'}' Literal.String.Interpol
+' ' Text
+'+' Operator
+' ' Text
+'10#' Literal.Number
+'${' Literal.String.Interpol
+'1' Name.Variable
+':' Punctuation
+'1' Name.Variable
+':' Punctuation
+'3' Name.Variable
+'}' Literal.String.Interpol
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10#' Literal.Number
+'${' Literal.String.Interpol
+'1' Name.Variable
+':' Punctuation
+'4' Name.Variable
+':' Punctuation
+'3' Name.Variable
+'}' Literal.String.Interpol
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10#' Literal.Number
+'$1' Name.Variable
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10#1' Literal.Number
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n\n' Text
+
+'m' Name.Variable
+'=' Operator
+'$((' Keyword
+'10' Literal.Number
+'))' Keyword
+'\n' Text
+
+'echo' Name.Builtin
+' ' Text
+'$m' Name.Variable
+'\n' Text