diff options
author | Matthäus G. Chajdas <dev@anteru.net> | 2020-09-08 19:45:20 +0200 |
---|---|---|
committer | Matthäus G. Chajdas <dev@anteru.net> | 2020-09-08 19:45:20 +0200 |
commit | 98f816ae5ca7d98f388ace349a29b154fa9dc9e1 (patch) | |
tree | d0494ebb40613432ef5c157c69c722393164710e /tests | |
parent | b6d1d68de705e1cfc28a4188f792b29c545bf7ed (diff) | |
parent | 945ed5ef268e2f3c7bbea42dfae1f8f844096f61 (diff) | |
download | pygments-git-98f816ae5ca7d98f388ace349a29b154fa9dc9e1.tar.gz |
Merge branch 'master' into bug/angular-html
Diffstat (limited to 'tests')
125 files changed, 1891 insertions, 996 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 35c9a781..30516d26 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -3,6 +3,6 @@ Pygments test package ~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/examplefiles/bare.bare b/tests/examplefiles/bare.bare new file mode 100644 index 00000000..ba2725ce --- /dev/null +++ b/tests/examplefiles/bare.bare @@ -0,0 +1,43 @@ +type PublicRSAKey data<128> +type PublicED25519Key data<32> +type Time string # ISO 8601 + +enum Department { + ACCOUNTING + ADMINISTRATION + CUSTOMER_SERVICE + DEVELOPMENT # IMPORTANT + + # Reserved for the CEO + JSMITH = 99 +} + +type Customer { + name: string + email: string + address: Address + orders: []{ + orderId: i64 + quantity: i32 + } + metadata: map[string]data +} + +type Employee { + name: string + email: string + address: Address + department: Department + hireDate: Time + publicKey: optional<(PublicRSAKey | PublicED25519Key)> + metadata: map[string]data +} + +type Person (Customer | Employee) + +type Address { + address: [4]string + city: string + state: string + country: string +} diff --git a/tests/examplefiles/example.promql b/tests/examplefiles/example.promql new file mode 100644 index 00000000..e2fee087 --- /dev/null +++ b/tests/examplefiles/example.promql @@ -0,0 +1,8 @@ +# A metric with label filtering +go_gc_duration_seconds{instance="localhost:9090", job="alertmanager"} + +# Aggregation operators +sum by (app, proc) ( + instance_memory_limit_bytes - instance_memory_usage_bytes +) / 1024 / 1024 + diff --git a/tests/examplefiles/example.ptls b/tests/examplefiles/example.ptls new file mode 100644 index 00000000..f3dc641a --- /dev/null +++ b/tests/examplefiles/example.ptls @@ -0,0 +1,30 @@ + +----------------------------------------------------------- +-- Print the lyrics to the song '99 bottles of beer' + +output = + range(99, 1) + |> map(showBeer) + |> printLines + +beerFmt = """{} of beer on the wall! +{} of beer! +You take one down, pass it around +{}""" + +showBeer(n) = + format( + beerFmt, + [showBottle(n), showBottle(n), nextBeer(n - 1)] + ) + +nextBeer(n) = + if n == 0 then "No more bottles of beer on the wall!" + else format("{} of beer on the wall!\n", [showBottle(n)]) + +----------------------------------------------------------- +-- Get appropriate singular / plural form of 'n bottle(s)' + +showBottle(n) = + format("{} {}", [n, bottleStr]) + where bottleStr = if n == 1 then "bottle" else "bottles" diff --git a/tests/examplefiles/fennelview.fnl b/tests/examplefiles/fennelview.fnl index fd0fc648..19d9c167 100644 --- a/tests/examplefiles/fennelview.fnl +++ b/tests/examplefiles/fennelview.fnl @@ -1,13 +1,13 @@ ;; A pretty-printer that outputs tables in Fennel syntax. ;; Loosely based on inspect.lua: http://github.com/kikito/inspect.lua -(local quote (fn [str] (.. '"' (: str :gsub '"' '\\"') '"'))) +(fn view-quote [str] (.. "\"" (: str :gsub "\"" "\\\"") "\"")) (local short-control-char-escapes {"\a" "\\a" "\b" "\\b" "\f" "\\f" "\n" "\\n" "\r" "\\r" "\t" "\\t" "\v" "\\v"}) -(local long-control-char-esapes +(local long-control-char-escapes (let [long {}] (for [i 0 31] (let [ch (string.char i)] @@ -17,9 +17,10 @@ long)) (fn escape [str] - (let [str (: str :gsub "\\" "\\\\") - str (: str :gsub "(%c)%f[0-9]" long-control-char-esapes)] - (: str :gsub "%c" short-control-char-escapes))) + (-> str + (: :gsub "\\" "\\\\") + (: :gsub "(%c)%f[0-9]" long-control-char-escapes) + (: :gsub "%c" short-control-char-escapes))) (fn sequence-key? [k len] (and (= (type k) "number") @@ -32,7 +33,7 @@ (fn sort-keys [a b] (let [ta (type a) tb (type b)] - (if (and (= ta tb) (~= ta "boolean") + (if (and (= ta tb) (or (= ta "string") (= ta "number"))) (< a b) (let [dta (. type-order a) @@ -58,13 +59,12 @@ (values keys sequence-length))) (fn count-table-appearances [t appearances] - (if (= (type t) "table") - (when (not (. appearances t)) - (tset appearances t 1) - (each [k v (pairs t)] - (count-table-appearances k appearances) - (count-table-appearances v appearances))) - (when (and t (= t t)) ; no nans please + (when (= (type t) "table") + (if (not (. appearances t)) + (do (tset appearances t 1) + (each [k v (pairs t)] + (count-table-appearances k appearances) + (count-table-appearances v appearances))) (tset appearances t (+ (or (. appearances t) 0) 1)))) appearances) @@ -78,7 +78,7 @@ (fn tabify [self] (puts self "\n" (: self.indent :rep self.level))) -(fn already-visited? [self v] (~= (. self.ids v) nil)) +(fn already-visited? [self v] (not= (. self.ids v) nil)) (fn get-id [self v] (var id (. self.ids v)) @@ -89,54 +89,70 @@ (tset self.ids v id))) (tostring id)) -(fn put-sequential-table [self t length] +(fn put-sequential-table [self t len] (puts self "[") (set self.level (+ self.level 1)) - (for [i 1 length] - (puts self " ") + (for [i 1 len] + (when (< 1 i (+ 1 len)) + (puts self " ")) (put-value self (. t i))) (set self.level (- self.level 1)) - (puts self " ]")) + (puts self "]")) (fn put-key [self k] (if (and (= (type k) "string") - (: k :find "^[-%w?\\^_`!#$%&*+./@~:|<=>]+$")) + (: k :find "^[-%w?\\^_!$%&*+./@:|<=>]+$")) (puts self ":" k) (put-value self k))) -(fn put-kv-table [self t] +(fn put-kv-table [self t ordered-keys] (puts self "{") (set self.level (+ self.level 1)) - (each [k v (pairs t)] - (tabify self) + ;; first, output sorted nonsequential keys + (each [i k (ipairs ordered-keys)] + (when (or self.table-edges (not= i 1)) + (tabify self)) (put-key self k) (puts self " ") + (put-value self (. t k))) + ;; next, output any sequential keys + (each [i v (ipairs t)] + (tabify self) + (put-key self i) + (puts self " ") (put-value self v)) (set self.level (- self.level 1)) - (tabify self) + (when self.table-edges + (tabify self)) (puts self "}")) (fn put-table [self t] - (if (already-visited? self t) - (puts self "#<table " (get-id self t) ">") - (>= self.level self.depth) - (puts self "{...}") - :else - (let [(non-seq-keys length) (get-nonsequential-keys t) - id (get-id self t)] - (if (> (. self.appearances t) 1) - (puts self "#<" id ">") - (and (= (# non-seq-keys) 0) (= (# t) 0)) - (puts self "{}") - (= (# non-seq-keys) 0) - (put-sequential-table self t length) - :else - (put-kv-table self t))))) + (let [metamethod (and self.metamethod? (-?> t getmetatable (. :__fennelview)))] + (if (and (already-visited? self t) self.detect-cycles?) + (puts self "#<table @" (get-id self t) ">") + (>= self.level self.depth) + (puts self "{...}") + metamethod + (puts self (metamethod t self.fennelview)) + :else + (let [(non-seq-keys len) (get-nonsequential-keys t) + id (get-id self t)] + ;; fancy metatable stuff can result in self.appearances not including + ;; a table, so if it's not found, assume we haven't seen it; we can't + ;; do cycle detection in that case. + (when (and (< 1 (or (. self.appearances t) 0)) self.detect-cycles?) + (puts self "@" id)) + (if (and (= (length non-seq-keys) 0) (= (length t) 0)) + (puts self (if self.empty-as-square "[]" "{}")) + (= (length non-seq-keys) 0) + (put-sequential-table self t len) + :else + (put-kv-table self t non-seq-keys)))))) (set put-value (fn [self v] (let [tv (type v)] (if (= tv "string") - (puts self (quote (escape v))) + (puts self (view-quote (escape v))) (or (= tv "number") (= tv "boolean") (= tv "nil")) (puts self (tostring v)) (= tv "table") @@ -146,11 +162,41 @@ -(fn fennelview [root options] +(fn one-line [str] + ;; save return value as local to ignore gsub's extra return value + (let [ret (-> str + (: :gsub "\n" " ") + (: :gsub "%[ " "[") (: :gsub " %]" "]") + (: :gsub "%{ " "{") (: :gsub " %}" "}") + (: :gsub "%( " "(") (: :gsub " %)" ")"))] + ret)) + +(fn fennelview [x options] + "Return a string representation of x. + +Can take an options table with these keys: +* :one-line (boolean: default: false) keep the output string as a one-liner +* :depth (number, default: 128) limit how many levels to go (default: 128) +* :indent (string, default: \" \") use this string to indent each level +* :detect-cycles? (boolean, default: true) don't try to traverse a looping table +* :metamethod? (boolean: default: true) use the __fennelview metamethod if found +* :table-edges (boolean: default: true) put {} table brackets on their own line +* :empty-as-square (boolean: default: false) render empty tables as [], not {} + +The __fennelview metamethod should take the table being serialized as its first +argument and a function as its second arg which can be used on table elements to +continue the fennelview process on them. +" (let [options (or options {}) - inspector {:appearances (count-table-appearances root {}) + inspector {:appearances (count-table-appearances x {}) :depth (or options.depth 128) :level 0 :buffer {} :ids {} :max-ids {} - :indent (or options.indent " ")}] - (put-value inspector root) - (table.concat inspector.buffer))) + :indent (or options.indent (if options.one-line "" " ")) + :detect-cycles? (not (= false options.detect-cycles?)) + :metamethod? (not (= false options.metamethod?)) + :fennelview #(fennelview $1 options) + :table-edges (not= options.table-edges false) + :empty-as-square options.empty-as-square}] + (put-value inspector x) + (let [str (table.concat inspector.buffer)] + (if options.one-line (one-line str) str)))) diff --git a/tests/examplefiles/mysql.txt b/tests/examplefiles/mysql.txt new file mode 100644 index 00000000..4927abd8 --- /dev/null +++ b/tests/examplefiles/mysql.txt @@ -0,0 +1,132 @@ +-- Samples of MySQL parsing
+
+
+-- Comments
+# standalone comment line
+-- standalone comment line
+SELECT 1; -- trailing comment
+SELECT 1; # trailing comment
+SELECT 1; /* trailing comment */
+SELECT /* interruption */ /**/ 1;
+ /*
+ Multiline / * / comment
+ */
+ /* /* MySQL does not support nested comments */
+SELECT 'If this line is a comment then nested commenting is enabled (and therefore broken).';
+
+
+-- Optimizer hints
+SELECT /*+ SEMIJOIN(FIRSTMATCH, LOOSESCAN) */ 1;
+SELECT /*+ SET_VAR(foreign_key_checks=OFF) */ 1;
+
+
+-- Literals
+SELECT
+ -- Integers
+ 123,
+
+ -- Floats
+ .123, 1.23, 123.,
+
+ -- Exponents
+ 1e10, 1e-10, 1.e20, .1e-20,
+
+ -- Hexadecimal
+ X'0af019', x'0AF019', 0xaf019,
+
+ -- Binary
+ B'010', b'010', 0b010,
+
+ -- Temporal literals
+ {d'2020-01-01'}, { d ' 2020^01@01 ' },
+ {t'8 9:10:11'}, { t ' 09:10:11.12 ' }, { t ' 091011 ' },
+ {ts"2020-01-01 09:10:11"}, { ts ' 2020@01/01 09:10:11 ' },
+
+ -- Strings
+ '', 'abc', '1''2\03\%4\_5\\6\'7\"8',
+ "", "abc", "1""2\03\%4\_5\\6\'7\"8",
+;
+
+
+-- Variables
+SET @a = 1, @1 = 2, @._.$ = 3;
+SET @'?' = 1, @'abc''def"`ghi' = 2;
+SET @"#" = 1, @"abc""def'`ghi" = 2;
+SET @`^` = 1, @`abc``def'"ghi` = 2;
+SELECT
+ @@timestamp,
+ @@global.auto_increment_offset,
+ @@session.auto_increment_offset,
+ @@auto_increment_offset
+;
+
+
+-- Prepared statements
+SELECT POW(?, 3) AS cubed;
+
+
+-- Constants
+SELECT TRUE, FALSE, NULL, UNKNOWN;
+
+
+-- Data types
+CREATE TABLE table1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(20) NOT NULL,
+ birthyear YEAR
+);
+
+
+-- Keywords
+INSERT INTO table1 (person, birthyear) VALUES ('abc', 2020);
+
+WITH RECURSIVE example (n) AS (
+ SELECT 1
+ UNION ALL
+ SELECT n + 1 FROM example
+ WHERE n < 10
+)
+SELECT n FROM example;
+
+SELECT 17 MEMBER OF ('[23, "abc", 17, "ab", 10]');
+
+
+-- Functions
+SELECT CONCAT('function');
+SELECT MAX(quantity) FROM example;
+
+
+-- Schema object names
+CREATE TABLE basic (
+ example INT,
+ 股票编号 INT,
+ `select` INT,
+ `concat(` INT
+);
+
+SELECT e1.`apple` AS a, `example2`.b
+FROM example1 AS e1
+JOIN example2 e2
+ON `example1`.`id` = e2.id;
+
+
+-- Operators
+SELECT 1 + 2 - 3 << 2;
+SELECT 1::DECIMAL(5, 2);
+SET @a = 1;
+SET a := 1;
+SELECT c->>'$.name' FROM example;
+
+
+
+-- Exceptions
+CREATE TABLE t1
+(
+ c1 VARCHAR(5) CHARACTER SET latin1,
+ c2 SET('r', 'g', 'b')
+);
+
+
+-- Introducers
+SELECT _latin1'abc';
+SELECT _binary'abc';
diff --git a/tests/examplefiles/psysh_test.psysh b/tests/examplefiles/psysh_test.psysh new file mode 100644 index 00000000..4ab9b134 --- /dev/null +++ b/tests/examplefiles/psysh_test.psysh @@ -0,0 +1,47 @@ +>>> (int) 10.88 +=> 10 +>>> (string) 10.88 +=> "10.88" +>>> (bool) 10.88 +=> true +>>> (array) 10.88 +=> [ + 10.88, + ] +>>> $object = (object) 10.88 +=> {#2373 + +"scalar": 10.88, + } +>>> $object->scalar +=> 10.88 +>>> $fileHandle = fopen('hello.txt', 'w'); +=> stream resource #400 +>>> (int) $fileHandle +=> 400 +>>> (string) $fileHandle +=> "Resource id #400" +>>> $greeting = 'Hello!'; +=> "Hello!" +>>> $_greeting = 'Hello!'; +=> "Hello!" +>>> $gruß = 'Hallo!'; +=> "Hallo!" +>>> namespace Foo\Bar; +>>> class Baz { +... public function getBaz(): string { +... return 'baz'; +... } +... } +>>> $baz = new Foo\Bar\Baz(); +PHP Fatal error: Class 'Foo/Bar/Foo/Bar/Baz' not + found in Psy Shell code on line 1 +>>> $baz = new Baz(); +=> Foo\Bar\Baz {#2382} +>>> $baz->getBaz(); +=> "baz" +>>> $greeting = function($name): string { +... return "Hello, {$name}"; +... }; +=> Closure($name): string {#2371 …3} +>>> $greeting('World') +=> "Hello, World" diff --git a/tests/examplefiles/test.sco b/tests/examplefiles/test.sco index cffcfded..4f1298d8 100644 --- a/tests/examplefiles/test.sco +++ b/tests/examplefiles/test.sco @@ -3,7 +3,7 @@ */ ; comment // comment -a b C d e f i q s t v x y +a B b C d e f i q s t v x y z np0 nP1 Np2 NP3 m/**/label; diff --git a/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_anchor.html b/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_anchor.html index 78b7675e..4c247cbc 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_anchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_anchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos">1</span><span class="c1"># a</span> - <span class="linenos">2</span><span class="c1"># b</span> - <span class="linenos">3</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos">1</span><span class="c1"># a</span> +<span class="linenos">2</span><span class="c1"># b</span> +<span class="linenos">3</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_noanchor.html b/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_noanchor.html index 78b7675e..4c247cbc 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos">1</span><span class="c1"># a</span> - <span class="linenos">2</span><span class="c1"># b</span> - <span class="linenos">3</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos">1</span><span class="c1"># a</span> +<span class="linenos">2</span><span class="c1"># b</span> +<span class="linenos">3</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_anchor.html b/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_anchor.html index a133f7a8..0200a290 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_anchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_anchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos">1</span><span class="c1"># a</span> - <span class="linenos">2</span><span class="c1"># b</span> - <span class="linenos special">3</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos">1</span><span class="c1"># a</span> +<span class="linenos">2</span><span class="c1"># b</span> +<span class="linenos special">3</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_noanchor.html b/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_noanchor.html index a133f7a8..0200a290 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos">1</span><span class="c1"># a</span> - <span class="linenos">2</span><span class="c1"># b</span> - <span class="linenos special">3</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos">1</span><span class="c1"># a</span> +<span class="linenos">2</span><span class="c1"># b</span> +<span class="linenos special">3</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_anchor.html b/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_anchor.html index e4000c6e..53dc0e72 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_anchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_anchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> 8</span><span class="c1"># a</span> - <span class="linenos"> 9</span><span class="c1"># b</span> - <span class="linenos">10</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> 8</span><span class="c1"># a</span> +<span class="linenos"> 9</span><span class="c1"># b</span> +<span class="linenos">10</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_noanchor.html b/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_noanchor.html index e4000c6e..53dc0e72 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> 8</span><span class="c1"># a</span> - <span class="linenos"> 9</span><span class="c1"># b</span> - <span class="linenos">10</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> 8</span><span class="c1"># a</span> +<span class="linenos"> 9</span><span class="c1"># b</span> +<span class="linenos">10</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_3_anchor.html b/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_3_anchor.html index bcbd693c..1f2f5cac 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_3_anchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_3_anchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> 8</span><span class="c1"># a</span> - <span class="linenos special"> 9</span><span class="c1"># b</span> - <span class="linenos">10</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> 8</span><span class="c1"># a</span> +<span class="linenos special"> 9</span><span class="c1"># b</span> +<span class="linenos">10</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_3_noanchor.html b/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_3_noanchor.html index bcbd693c..1f2f5cac 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_3_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> 8</span><span class="c1"># a</span> - <span class="linenos special"> 9</span><span class="c1"># b</span> - <span class="linenos">10</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> 8</span><span class="c1"># a</span> +<span class="linenos special"> 9</span><span class="c1"># b</span> +<span class="linenos">10</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_0_anchor.html b/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_0_anchor.html index 56275271..911d9b9b 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_0_anchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_0_anchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> </span><span class="c1"># a</span> - <span class="linenos">2</span><span class="c1"># b</span> - <span class="linenos"> </span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> </span><span class="c1"># a</span> +<span class="linenos">2</span><span class="c1"># b</span> +<span class="linenos"> </span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_0_noanchor.html b/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_0_noanchor.html index 56275271..911d9b9b 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_0_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> </span><span class="c1"># a</span> - <span class="linenos">2</span><span class="c1"># b</span> - <span class="linenos"> </span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> </span><span class="c1"># a</span> +<span class="linenos">2</span><span class="c1"># b</span> +<span class="linenos"> </span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_3_anchor.html b/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_3_anchor.html index 9f10418b..7f2c5181 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_3_anchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_3_anchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> </span><span class="c1"># a</span> - <span class="linenos">2</span><span class="c1"># b</span> - <span class="linenos special"> </span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> </span><span class="c1"># a</span> +<span class="linenos">2</span><span class="c1"># b</span> +<span class="linenos special"> </span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_3_noanchor.html b/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_3_noanchor.html index 9f10418b..7f2c5181 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_2_start_1_special_3_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> </span><span class="c1"># a</span> - <span class="linenos">2</span><span class="c1"># b</span> - <span class="linenos special"> </span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> </span><span class="c1"># a</span> +<span class="linenos">2</span><span class="c1"># b</span> +<span class="linenos special"> </span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_0_anchor.html b/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_0_anchor.html index 490d7484..ce635c0e 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_0_anchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_0_anchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> 8</span><span class="c1"># a</span> - <span class="linenos"> </span><span class="c1"># b</span> - <span class="linenos">10</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> 8</span><span class="c1"># a</span> +<span class="linenos"> </span><span class="c1"># b</span> +<span class="linenos">10</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_0_noanchor.html b/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_0_noanchor.html index 490d7484..ce635c0e 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_0_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> 8</span><span class="c1"># a</span> - <span class="linenos"> </span><span class="c1"># b</span> - <span class="linenos">10</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> 8</span><span class="c1"># a</span> +<span class="linenos"> </span><span class="c1"># b</span> +<span class="linenos">10</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_3_anchor.html b/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_3_anchor.html index d6b50fbb..08d3da78 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_3_anchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_3_anchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> 8</span><span class="c1"># a</span> - <span class="linenos special"> </span><span class="c1"># b</span> - <span class="linenos">10</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> 8</span><span class="c1"># a</span> +<span class="linenos special"> </span><span class="c1"># b</span> +<span class="linenos">10</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_3_noanchor.html b/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_3_noanchor.html index d6b50fbb..08d3da78 100644 --- a/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/inline_cls_step_2_start_8_special_3_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight"> - <pre> - <span></span> - <span class="linenos"> 8</span><span class="c1"># a</span> - <span class="linenos special"> </span><span class="c1"># b</span> - <span class="linenos">10</span><span class="c1"># c</span> - </pre> + <pre><span></span><span class="linenos"> 8</span><span class="c1"># a</span> +<span class="linenos special"> </span><span class="c1"># b</span> +<span class="linenos">10</span><span class="c1"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_0_anchor.html b/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_0_anchor.html index 6bbdf29c..24fcc2f6 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_0_anchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_0_anchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">3</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">3</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_0_noanchor.html b/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_0_noanchor.html index 6bbdf29c..24fcc2f6 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_0_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">3</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">3</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_3_anchor.html b/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_3_anchor.html index 33b6330f..b6245f11 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_3_anchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_3_anchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;">3</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;">3</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_3_noanchor.html b/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_3_noanchor.html index 33b6330f..b6245f11 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_1_start_1_special_3_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;">3</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;">3</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_0_anchor.html b/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_0_anchor.html index 2692b73d..d38e2bab 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_0_anchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_0_anchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 9</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 9</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_0_noanchor.html b/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_0_noanchor.html index 2692b73d..d38e2bab 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_0_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 9</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 9</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_3_anchor.html b/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_3_anchor.html index c1a67b5c..332f729f 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_3_anchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_3_anchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> 9</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> 9</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_3_noanchor.html b/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_3_noanchor.html index c1a67b5c..332f729f 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_1_start_8_special_3_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> 9</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> 9</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_0_anchor.html b/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_0_anchor.html index 1a9e833a..9367b9c0 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_0_anchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_0_anchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_0_noanchor.html b/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_0_noanchor.html index 1a9e833a..9367b9c0 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_0_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_3_anchor.html b/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_3_anchor.html index cd89d205..6843e0f7 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_3_anchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_3_anchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_3_noanchor.html b/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_3_noanchor.html index cd89d205..6843e0f7 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_2_start_1_special_3_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_0_anchor.html b/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_0_anchor.html index 8f078e42..09bf305b 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_0_anchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_0_anchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_0_noanchor.html b/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_0_noanchor.html index 8f078e42..09bf305b 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_0_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_3_anchor.html b/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_3_anchor.html index 7d0ecdd8..39d7fc06 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_3_anchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_3_anchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_3_noanchor.html b/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_3_noanchor.html index 7d0ecdd8..39d7fc06 100644 --- a/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/inline_nocls_step_2_start_8_special_3_noanchor.html @@ -1,8 +1,6 @@ <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> - <span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># b</span> - <span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> - </pre> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span><span style="color: #408080; font-style: italic"># b</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span><span style="color: #408080; font-style: italic"># c</span> +</pre> </div> diff --git a/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_0_anchor.html b/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_0_anchor.html index a34780d8..36653531 100644 --- a/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_0_anchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_0_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre><a href="#-1">1</a></pre> - <pre><a href="#-2">2</a></pre> - <pre><a href="#-3">3</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><a href="#-1">1</a> +<a href="#-2">2</a> +<a href="#-3">3</a></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_0_noanchor.html b/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_0_noanchor.html index 04037b2c..ddc7594e 100644 --- a/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_0_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre>1</pre> - <pre>2</pre> - <pre>3</pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre>1 +2 +3</pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_3_anchor.html b/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_3_anchor.html index c6f89066..ab0fdfb3 100644 --- a/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_3_anchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_3_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre><a href="#-1">1</a></pre> - <pre><a href="#-2">2</a></pre> - <pre class="special"><a href="#-3">3</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><a href="#-1">1</a> +<a href="#-2">2</a> +<span class="special"><a href="#-3">3</a></span></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_3_noanchor.html b/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_3_noanchor.html index 464b1b32..1f3c424b 100644 --- a/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_1_start_1_special_3_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre>1</pre> - <pre>2</pre> - <pre class="special">3</pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre>1 +2 +<span class="special">3</span></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_0_anchor.html b/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_0_anchor.html index 0eacbbaf..03ff1442 100644 --- a/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_0_anchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_0_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre><a href="#-8"> 8</a></pre> - <pre><a href="#-9"> 9</a></pre> - <pre><a href="#-10">10</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><a href="#-8"> 8</a> +<a href="#-9"> 9</a> +<a href="#-10">10</a></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_0_noanchor.html b/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_0_noanchor.html index c274351c..b8bf29ee 100644 --- a/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_0_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre> 8</pre> - <pre> 9</pre> - <pre>10</pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre> 8 + 9 +10</pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_3_anchor.html b/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_3_anchor.html index 95521c15..98d1abbb 100644 --- a/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_3_anchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_3_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre><a href="#-8"> 8</a></pre> - <pre class="special"><a href="#-9"> 9</a></pre> - <pre><a href="#-10">10</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><a href="#-8"> 8</a> +<span class="special"><a href="#-9"> 9</a></span> +<a href="#-10">10</a></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_3_noanchor.html b/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_3_noanchor.html index 07601811..67642acd 100644 --- a/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_1_start_8_special_3_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre> 8</pre> - <pre class="special"> 9</pre> - <pre>10</pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre> 8 +<span class="special"> 9</span> +10</pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_0_anchor.html b/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_0_anchor.html index 566d4bcc..80e5bdb1 100644 --- a/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_0_anchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_0_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre> </pre> - <pre><a href="#-2">2</a></pre> - <pre> </pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre> +<a href="#-2">2</a> + </pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_0_noanchor.html b/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_0_noanchor.html index b19d9af6..a95ad95f 100644 --- a/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_0_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre> </pre> - <pre>2</pre> - <pre> </pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre> +2 + </pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_3_anchor.html b/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_3_anchor.html index 921c13c9..1a4cc59f 100644 --- a/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_3_anchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_3_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre> </pre> - <pre><a href="#-2">2</a></pre> - <pre class="special"> </pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre> +<a href="#-2">2</a> +<span class="special"> </span></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_3_noanchor.html b/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_3_noanchor.html index dd177c14..34b469e9 100644 --- a/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_2_start_1_special_3_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre> </pre> - <pre>2</pre> - <pre class="special"> </pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre> +2 +<span class="special"> </span></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_0_anchor.html b/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_0_anchor.html index a3091766..3bbb52a5 100644 --- a/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_0_anchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_0_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre><a href="#-8"> 8</a></pre> - <pre> </pre> - <pre><a href="#-10">10</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><a href="#-8"> 8</a> + +<a href="#-10">10</a></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_0_noanchor.html b/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_0_noanchor.html index cfc968ff..907c06fc 100644 --- a/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_0_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre> 8</pre> - <pre> </pre> - <pre>10</pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre> 8 + +10</pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_3_anchor.html b/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_3_anchor.html index 1b30e6d7..a39b486d 100644 --- a/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_3_anchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_3_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre><a href="#-8"> 8</a></pre> - <pre class="special"> </pre> - <pre><a href="#-10">10</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><a href="#-8"> 8</a> +<span class="special"> </span> +<a href="#-10">10</a></pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_3_noanchor.html b/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_3_noanchor.html index 2a5ebde0..25bde602 100644 --- a/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/table_cls_step_2_start_8_special_3_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre> 8</pre> - <pre class="special"> </pre> - <pre>10</pre> - </div> - </td> - <td class="code"> - <div class="highlight"> - <pre> - <span></span> - <span class="c1"># a</span> - <span class="c1"># b</span> - <span class="c1"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre> 8 +<span class="special"> </span> +10</pre> + </div> + </td> + <td class="code"> + <div class="highlight"> + <pre><span></span><span class="c1"># a</span> +<span class="c1"># b</span> +<span class="c1"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_0_anchor.html b/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_0_anchor.html index 86ce85ea..92e4e413 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_0_anchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_0_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-1">1</a></pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-2">2</a></pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-3">3</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-1">1</a></span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-2">2</a></span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-3">3</a></span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_0_noanchor.html b/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_0_noanchor.html index c32f2745..196033a1 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_0_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">3</pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">3</span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_3_anchor.html b/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_3_anchor.html index 1d17cad9..afa6152a 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_3_anchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_3_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-1">1</a></pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-2">2</a></pre> - <pre style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"><a href="#-3">3</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-1">1</a></span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-2">2</a></span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"><a href="#-3">3</a></span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_3_noanchor.html b/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_3_noanchor.html index 7b3bc29c..a72788df 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_1_start_1_special_3_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</pre> - <pre style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;">3</pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">1</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;">3</span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_0_anchor.html b/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_0_anchor.html index c61cb280..23ed43af 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_0_anchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_0_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-8"> 8</a></pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-9"> 9</a></pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-10">10</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-8"> 8</a></span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-9"> 9</a></span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-10">10</a></span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_0_noanchor.html b/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_0_noanchor.html index af07ebb1..3248ba3a 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_0_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 9</pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 9</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_3_anchor.html b/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_3_anchor.html index 122283b6..276b76d5 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_3_anchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_3_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-8"> 8</a></pre> - <pre style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"><a href="#-9"> 9</a></pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-10">10</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-8"> 8</a></span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"><a href="#-9"> 9</a></span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-10">10</a></span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_3_noanchor.html b/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_3_noanchor.html index f50cdcdd..4298ac69 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_1_start_8_special_3_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</pre> - <pre style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> 9</pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> 9</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_0_anchor.html b/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_0_anchor.html index 6ed8c005..15c4975e 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_0_anchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_0_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-2">2</a></pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-2">2</a></span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_0_noanchor.html b/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_0_noanchor.html index dba1249b..987bd12d 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_0_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_3_anchor.html b/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_3_anchor.html index 69bf7428..da570378 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_3_anchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_3_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-2">2</a></pre> - <pre style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-2">2</a></span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_3_noanchor.html b/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_3_noanchor.html index 87660afb..0f502688 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_2_start_1_special_3_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</pre> - <pre style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">2</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_0_anchor.html b/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_0_anchor.html index ac7570f3..d0bef32d 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_0_anchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_0_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-8"> 8</a></pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-10">10</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-8"> 8</a></span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-10">10</a></span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_0_noanchor.html b/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_0_noanchor.html index 035aa795..98b94471 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_0_noanchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_0_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> </span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_3_anchor.html b/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_3_anchor.html index 0ed43dbd..baa70130 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_3_anchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_3_anchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-8"> 8</a></pre> - <pre style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-10">10</a></pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-8"> 8</a></span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"><a href="#-10">10</a></span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_3_noanchor.html b/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_3_noanchor.html index 13e38705..6ba03c4f 100644 --- a/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_3_noanchor.html +++ b/tests/html_linenos_expected_output/table_nocls_step_2_start_8_special_3_noanchor.html @@ -1,21 +1,19 @@ <table class="highlighttable"> - <tr> - <td class="linenos"> - <div class="linenodiv"> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</pre> - <pre style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </pre> - <pre style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</pre> - </div> - </td> - <td class="code"> - <div class="highlight" style="background: #f8f8f8"> - <pre style="line-height: 125%; margin: 0;"> - <span></span> - <span style="color: #408080; font-style: italic"># a</span> - <span style="color: #408080; font-style: italic"># b</span> - <span style="color: #408080; font-style: italic"># c</span> - </pre> - </div> - </td> - </tr> -</table> + <tr> + <td class="linenos"> + <div class="linenodiv"> + <pre><span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;"> 8</span> +<span style="color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px;"> </span> +<span style="color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px;">10</span></pre> + </div> + </td> + <td class="code"> + <div class="highlight" style="background: #f8f8f8"> + <pre style="line-height: 125%; margin: 0;"><span></span><span style="color: #408080; font-style: italic"># a</span> +<span style="color: #408080; font-style: italic"># b</span> +<span style="color: #408080; font-style: italic"># c</span> +</pre> + </div> + </td> + </tr> +</table>
\ No newline at end of file diff --git a/tests/test_apache_conf.py b/tests/test_apache_conf.py index 63f4f542..cdb8bc33 100644 --- a/tests/test_apache_conf.py +++ b/tests/test_apache_conf.py @@ -3,7 +3,7 @@ Basic Apache Configuration Test ~~~~~~~~~~~~~~~~~-------------- - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_asm.py b/tests/test_asm.py index 5bf69e38..d351ce30 100644 --- a/tests/test_asm.py +++ b/tests/test_asm.py @@ -3,7 +3,7 @@ Basic GasLexer/NasmLexer Test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_basic.py b/tests/test_basic.py index e2255f5b..e3826b28 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -3,7 +3,7 @@ Pygments Basic lexers tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py index ea555513..378ea5e4 100644 --- a/tests/test_basic_api.py +++ b/tests/test_basic_api.py @@ -3,7 +3,7 @@ Pygments basic API tests ~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_bibtex.py b/tests/test_bibtex.py index 756a6589..dfa668f2 100644 --- a/tests/test_bibtex.py +++ b/tests/test_bibtex.py @@ -3,7 +3,7 @@ BibTeX Test ~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_cfm.py b/tests/test_cfm.py index e3175215..a1600944 100644 --- a/tests/test_cfm.py +++ b/tests/test_cfm.py @@ -3,7 +3,7 @@ Basic ColdfusionHtmlLexer Test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_clexer.py b/tests/test_clexer.py index 69f39b24..d40ec491 100644 --- a/tests/test_clexer.py +++ b/tests/test_clexer.py @@ -3,7 +3,7 @@ Basic CLexer Test ~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index e11c666d..fe27df7f 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -3,7 +3,7 @@ Command line test ~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_coffeescript.py b/tests/test_coffeescript.py new file mode 100644 index 00000000..41ca8e0d --- /dev/null +++ b/tests/test_coffeescript.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +""" + CoffeeScript tests + ~~~~~~~~~~~~~~~~~~ + + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import pytest + +from pygments.lexers import CoffeeScriptLexer +from pygments.token import Token + +COFFEE_SLASH_GOLDEN = [ + # input_str, slashes_are_regex_here + (r'/\\/', True), + (r'/\\/i', True), + (r'/\//', True), + (r'/(\s)/', True), + ('/a{2,8}/', True), + ('/b*c?d+/', True), + ('/(capture-match)/', True), + ('/(?:do-not-capture-match)/', True), + ('/this|or|that/', True), + ('/[char-set]/', True), + ('/[^neg-char_st]/', True), + ('/^.*$/', True), + (r'/\n(\f)\0\1\d\b\cm\u1234/', True), + (r'/^.?([^/\\\n\w]*)a\1+$/.something(or_other) # something more complex', True), + ("foo = (str) ->\n /'|\"/.test str", True), + ('a = a / b / c', False), + ('a = a/b/c', False), + ('a = a/b/ c', False), + ('a = a /b/c', False), + ('a = 1 + /d/.test(a)', True), +] + + +@pytest.fixture(scope='module') +def lexer(): + yield CoffeeScriptLexer() + + +@pytest.mark.parametrize('golden', COFFEE_SLASH_GOLDEN) +def test_coffee_slashes(lexer, golden): + input_str, slashes_are_regex_here = golden + output = list(lexer.get_tokens(input_str)) + print(output) + for t, s in output: + if '/' in s: + is_regex = t is Token.String.Regex + assert is_regex == slashes_are_regex_here, (t, s) + + +def test_mixed_slashes(lexer): + fragment = u'a?/foo/:1/2;\n' + tokens = [ + (Token.Name.Other, u'a'), + (Token.Operator, u'?'), + (Token.Literal.String.Regex, u'/foo/'), + (Token.Operator, u':'), + (Token.Literal.Number.Integer, u'1'), + (Token.Operator, u'/'), + (Token.Literal.Number.Integer, u'2'), + (Token.Punctuation, u';'), + (Token.Text, u'\n'), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_beware_infinite_loop(lexer): + # This demonstrates the case that "This isn't really guarding" comment + # refers to. + fragment = '/a/x;\n' + tokens = [ + (Token.Text, ''), + (Token.Operator, '/'), + (Token.Name.Other, 'a'), + (Token.Operator, '/'), + (Token.Name.Other, 'x'), + (Token.Punctuation, ';'), + (Token.Text, '\n'), + ] + assert list(lexer.get_tokens(fragment)) == tokens diff --git a/tests/test_crystal.py b/tests/test_crystal.py index 30177e41..08aa7741 100644 --- a/tests/test_crystal.py +++ b/tests/test_crystal.py @@ -3,7 +3,7 @@ Basic CrystalLexer Test ~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_csound.py b/tests/test_csound.py index 7259cf5b..0186da7a 100644 --- a/tests/test_csound.py +++ b/tests/test_csound.py @@ -3,7 +3,7 @@ Csound lexer tests ~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_data.py b/tests/test_data.py index 23f1d4a0..9724d235 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -56,6 +56,34 @@ def test_basic_json(lexer_json): assert list(lexer_json.get_tokens(fragment)) == tokens +def test_json_escape_backtracking(lexer_json): + # This tests that an (invalid) sequence of escapes doesn't cause the lexer + # to fall into catastrophic backtracking. unfortunately, if it's broken + # this test will hang and that's how we know it's broken :( + fragment = r'{"\u00D0000\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\63CD' + tokens = ( + [(Token.Punctuation, u'{'), + (Token.Error, r'"'), + (Token.Error, '\\'), + (Token.Error, r'u'), + (Token.Error, r'0'), + (Token.Error, r'0'), + (Token.Error, r'D'), + (Token.Error, r'0'), + (Token.Error, r'0'), + (Token.Error, r'0'), + (Token.Error, r'0')] + + [(Token.Error, '\\')] * 178 + + [(Token.Error, r'6'), + (Token.Error, r'3'), + (Token.Error, r'C'), + (Token.Error, r'D'), + (Token.Text, '\n')] + ) + + assert list(lexer_json.get_tokens(fragment)) == tokens + + def test_basic_bare(lexer_bare): # This is the same as testBasic for JsonLexer above, except the # enclosing curly braces are removed. diff --git a/tests/test_examplefiles.py b/tests/test_examplefiles.py index 2486f876..22b5ced0 100644 --- a/tests/test_examplefiles.py +++ b/tests/test_examplefiles.py @@ -3,7 +3,7 @@ Pygments tests with example files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_grammar_notation.py b/tests/test_grammar_notation.py index b20ca975..0d7e6865 100644 --- a/tests/test_grammar_notation.py +++ b/tests/test_grammar_notation.py @@ -3,7 +3,7 @@ Basic Grammar Notation Tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_haskell.py b/tests/test_haskell.py index 515c19e9..f67db1fb 100644 --- a/tests/test_haskell.py +++ b/tests/test_haskell.py @@ -3,7 +3,7 @@ Haskell Tests ~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_hdl.py b/tests/test_hdl.py index 9d981202..f3975124 100644 --- a/tests/test_hdl.py +++ b/tests/test_hdl.py @@ -3,7 +3,7 @@ HDL Tests ~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_html_formatter.py b/tests/test_html_formatter.py index 75986db5..0a1b7a9a 100644 --- a/tests/test_html_formatter.py +++ b/tests/test_html_formatter.py @@ -3,7 +3,7 @@ Pygments HTML formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_inherit.py b/tests/test_inherit.py index 03527724..997748a6 100644 --- a/tests/test_inherit.py +++ b/tests/test_inherit.py @@ -3,7 +3,7 @@ Tests for inheritance in RegexLexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_irc_formatter.py b/tests/test_irc_formatter.py index af90731e..6dc43b7d 100644 --- a/tests/test_irc_formatter.py +++ b/tests/test_irc_formatter.py @@ -3,7 +3,7 @@ Pygments IRC formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_java.py b/tests/test_java.py index 94463246..467a3b72 100644 --- a/tests/test_java.py +++ b/tests/test_java.py @@ -3,7 +3,7 @@ Basic JavaLexer Test ~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_javascript.py b/tests/test_javascript.py index 25e06fdc..78350612 100644 --- a/tests/test_javascript.py +++ b/tests/test_javascript.py @@ -3,83 +3,82 @@ Javascript tests ~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import pytest -from pygments.lexers import CoffeeScriptLexer -from pygments.token import Token - -COFFEE_SLASH_GOLDEN = [ - # input_str, slashes_are_regex_here - (r'/\\/', True), - (r'/\\/i', True), - (r'/\//', True), - (r'/(\s)/', True), - ('/a{2,8}/', True), - ('/b*c?d+/', True), - ('/(capture-match)/', True), - ('/(?:do-not-capture-match)/', True), - ('/this|or|that/', True), - ('/[char-set]/', True), - ('/[^neg-char_st]/', True), - ('/^.*$/', True), - (r'/\n(\f)\0\1\d\b\cm\u1234/', True), - (r'/^.?([^/\\\n\w]*)a\1+$/.something(or_other) # something more complex', True), - ("foo = (str) ->\n /'|\"/.test str", True), - ('a = a / b / c', False), - ('a = a/b/c', False), - ('a = a/b/ c', False), - ('a = a /b/c', False), - ('a = 1 + /d/.test(a)', True), -] +from pygments.lexers.javascript import JavascriptLexer +from pygments.token import Number @pytest.fixture(scope='module') def lexer(): - yield CoffeeScriptLexer() - - -@pytest.mark.parametrize('golden', COFFEE_SLASH_GOLDEN) -def test_coffee_slashes(lexer, golden): - input_str, slashes_are_regex_here = golden - output = list(lexer.get_tokens(input_str)) - print(output) - for t, s in output: - if '/' in s: - is_regex = t is Token.String.Regex - assert is_regex == slashes_are_regex_here, (t, s) - - -def test_mixed_slashes(lexer): - fragment = u'a?/foo/:1/2;\n' - tokens = [ - (Token.Name.Other, u'a'), - (Token.Operator, u'?'), - (Token.Literal.String.Regex, u'/foo/'), - (Token.Operator, u':'), - (Token.Literal.Number.Integer, u'1'), - (Token.Operator, u'/'), - (Token.Literal.Number.Integer, u'2'), - (Token.Punctuation, u';'), - (Token.Text, u'\n'), - ] - assert list(lexer.get_tokens(fragment)) == tokens - - -def test_beware_infinite_loop(lexer): - # This demonstrates the case that "This isn't really guarding" comment - # refers to. - fragment = '/a/x;\n' - tokens = [ - (Token.Text, ''), - (Token.Operator, '/'), - (Token.Name.Other, 'a'), - (Token.Operator, '/'), - (Token.Name.Other, 'x'), - (Token.Punctuation, ';'), - (Token.Text, '\n'), - ] - assert list(lexer.get_tokens(fragment)) == tokens + yield JavascriptLexer() + + +@pytest.mark.parametrize( + 'text', + ( + '1', '1.', '.1', '1.1', '1e1', '1E1', '1e+1', '1E-1', '1.e1', '.1e1', + '0888', # octal prefix with non-octal numbers + ) +) +def test_float_literal_positive_matches(lexer, text): + """Test literals that should be tokenized as float literals.""" + assert list(lexer.get_tokens(text))[0] == (Number.Float, text) + + +@pytest.mark.parametrize('text', ('.\u0b6a', '.', '1..', '1n', '1ee', '1e', '1e-', '1e--1', '1e++1', '1e1.0')) +def test_float_literals_negative_matches(lexer, text): + """Test text that should **not** be tokenized as float literals.""" + assert list(lexer.get_tokens(text))[0] != (Number.Float, text) + + +@pytest.mark.parametrize('text', ('0n', '123n')) +def test_integer_literal_positive_matches(lexer, text): + """Test literals that should be tokenized as integer literals.""" + assert list(lexer.get_tokens(text))[0] == (Number.Integer, text) + + +@pytest.mark.parametrize('text', ('1N', '1', '1.0')) +def test_integer_literals_negative_matches(lexer, text): + """Test text that should **not** be tokenized as integer literals.""" + assert list(lexer.get_tokens(text))[0] != (Number.Integer, text) + + +@pytest.mark.parametrize('text', ('0b01', '0B10n')) +def test_binary_literal_positive_matches(lexer, text): + """Test literals that should be tokenized as binary literals.""" + assert list(lexer.get_tokens(text))[0] == (Number.Bin, text) + + +@pytest.mark.parametrize('text', ('0b0N', '0b', '0bb', '0b2')) +def test_binary_literals_negative_matches(lexer, text): + """Test text that should **not** be tokenized as binary literals.""" + assert list(lexer.get_tokens(text))[0] != (Number.Bin, text) + + +@pytest.mark.parametrize('text', ('017', '071n', '0o11', '0O77n')) +def test_octal_literal_positive_matches(lexer, text): + """Test literals that should be tokenized as octal literals.""" + assert list(lexer.get_tokens(text))[0] == (Number.Oct, text) + + +@pytest.mark.parametrize('text', ('01N', '089', '098n', '0o', '0OO', '0o88', '0O88n')) +def test_octal_literals_negative_matches(lexer, text): + """Test text that should **not** be tokenized as octal literals.""" + assert list(lexer.get_tokens(text))[0] != (Number.Oct, text) + + +@pytest.mark.parametrize('text', ('0x01', '0Xefn', '0x0EF')) +def test_hexadecimal_literal_positive_matches(lexer, text): + """Test literals that should be tokenized as hexadecimal literals.""" + assert list(lexer.get_tokens(text))[0] == (Number.Hex, text) + + +@pytest.mark.parametrize('text', ('0x0N', '0x', '0Xx', '0xg', '0xhn')) +def test_hexadecimal_literals_negative_matches(lexer, text): + """Test text that should **not** be tokenized as hexadecimal literals.""" + assert list(lexer.get_tokens(text))[0] != (Number.Hex, text) diff --git a/tests/test_julia.py b/tests/test_julia.py index 3f115931..e041377b 100644 --- a/tests/test_julia.py +++ b/tests/test_julia.py @@ -3,7 +3,7 @@ Julia Tests ~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_kotlin.py b/tests/test_kotlin.py index 69b19c17..2f0eb376 100644 --- a/tests/test_kotlin.py +++ b/tests/test_kotlin.py @@ -3,7 +3,7 @@ Basic JavaLexer Test ~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_latex_formatter.py b/tests/test_latex_formatter.py index 2a1c911e..64d99c6a 100644 --- a/tests/test_latex_formatter.py +++ b/tests/test_latex_formatter.py @@ -3,7 +3,7 @@ Pygments LaTeX formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_lexers_other.py b/tests/test_lexers_other.py index 70ffba17..1afefc98 100644 --- a/tests/test_lexers_other.py +++ b/tests/test_lexers_other.py @@ -3,7 +3,7 @@ Tests for other lexers ~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_make.py b/tests/test_make.py new file mode 100644 index 00000000..b311850c --- /dev/null +++ b/tests/test_make.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +""" + CMake Tests + ~~~~~~~~~~~ + + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexers import CMakeLexer, guess_lexer + + +def test_guess_cmake_lexer_from_header(): + headers = [ + "CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)", + "cmake_minimum_required(version 3.13) # CMake version check", + " CMAKE_MINIMUM_REQUIRED\t( VERSION 2.6 FATAL_ERROR ) ", + ] + for header in headers: + code = '\n'.join([ + header, + 'project(example)', + 'set(CMAKE_CXX_STANDARD 14)', + 'set(SOURCE_FILES main.cpp)', + 'add_executable(example ${SOURCE_FILES})', + ]) + lexer = guess_lexer(code) + assert isinstance(lexer, CMakeLexer), \ + "header must be detected as CMake: %r" % header diff --git a/tests/test_markdown_lexer.py b/tests/test_markdown_lexer.py index 524becd7..362e6da4 100644 --- a/tests/test_markdown_lexer.py +++ b/tests/test_markdown_lexer.py @@ -3,7 +3,7 @@ Pygments Markdown lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_matlab.py b/tests/test_matlab.py index 0ac1df95..4a94f351 100644 --- a/tests/test_matlab.py +++ b/tests/test_matlab.py @@ -198,7 +198,6 @@ def test_command_mode(lexer): (Token.Name, 'help'), (Token.Text, ' '), (Token.Literal.String, 'sin'), - (Token.Punctuation, ''), (Token.Text, '\n'), ] assert list(lexer.get_tokens(fragment)) == tokens diff --git a/tests/test_modeline.py b/tests/test_modeline.py index 4d85a436..f7dbe8c1 100644 --- a/tests/test_modeline.py +++ b/tests/test_modeline.py @@ -3,7 +3,7 @@ Tests for the vim modeline feature ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_mysql.py b/tests/test_mysql.py new file mode 100644 index 00000000..9b5e2b8c --- /dev/null +++ b/tests/test_mysql.py @@ -0,0 +1,249 @@ +# -*- coding: utf-8 -*- +""" + Pygments MySQL lexer tests + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import pytest + +from pygments.lexers.sql import MySqlLexer + +from pygments.token import \ + Comment, \ + Keyword, \ + Literal, \ + Name, \ + Number, \ + Operator, \ + Punctuation, \ + String, \ + Text + + +@pytest.fixture(scope='module') +def lexer(): + yield MySqlLexer() + + +@pytest.mark.parametrize('text', ('123',)) +def test_integer_literals(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Number.Integer, text) + + +@pytest.mark.parametrize( + 'text', + ( + '.123', '1.23', '123.', + '1e10', '1.0e10', '1.e-10', '.1e+10', + ), +) +def test_float_literals(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Number.Float, text) + + +@pytest.mark.parametrize('text', ("X'0af019'", "x'0AF019'", "0xaf019")) +def test_hexadecimal_literals(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Number.Hex, text) + + +@pytest.mark.parametrize('text', ("B'010'", "b'010'", "0b010")) +def test_binary_literals(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Number.Bin, text) + + +@pytest.mark.parametrize( + 'text', + ( + "{d'2020-01-01'}", "{ d ' 2020^01@01 ' }", + "{t'8 9:10:11'}", "{ t ' 09:10:11.12 ' }", "{ t ' 091011 ' }", + '{ts"2020-01-01 09:10:11"}', "{ ts ' 2020@01/01 09:10:11 ' }", + ), +) +def test_temporal_literals(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Literal.Date, text) + + +@pytest.mark.parametrize( + 'text, expected_types', + ( + (r"'a'", (String.Single,) * 3), + (r"""'""'""", (String.Single,) * 3), + (r"''''", (String.Single, String.Escape, String.Single)), + (r"'\''", (String.Single, String.Escape, String.Single)), + (r'"a"', (String.Double,) * 3), + (r'''"''"''', (String.Double,) * 3), + (r'""""', (String.Double, String.Escape, String.Double)), + (r'"\""', (String.Double, String.Escape, String.Double)), + ), +) +def test_string_literals(lexer, text, expected_types): + tokens = list(lexer.get_tokens(text))[:len(expected_types)] + assert all(t[0] == e for t, e in zip(tokens, expected_types)) + + +@pytest.mark.parametrize( + 'text', + ( + "@a", "@1", "@._.$", + "@'?'", """@'abc''def"`ghi'""", + '@"#"', '''@"abc""def'`ghi"''', + '@`^`', """@`abc``def'"ghi`""", + "@@timestamp", + "@@session.auto_increment_offset", + "@@global.auto_increment_offset", + "@@persist.auto_increment_offset", + "@@persist_only.auto_increment_offset", + '?', + ), +) +def test_variables(lexer, text): + tokens = list(lexer.get_tokens(text)) + assert all(t[0] == Name.Variable for t in tokens[:-1]) + assert ''.join([t[1] for t in tokens]).strip() == text.strip() + + +@pytest.mark.parametrize('text', ('true', 'false', 'null', 'unknown')) +def test_constants(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Name.Constant, text) + + +@pytest.mark.parametrize('text', ('-- abc', '--\tabc', '#abc')) +def test_comments_single_line(lexer, text): + # Test the standalone comment. + tokens = list(lexer.get_tokens(text)) + assert tokens[0] == (Comment.Single, text) + + # Test the comment with mixed tokens. + tokens = list(lexer.get_tokens('select' + text + '\nselect')) + assert tokens[0] == (Keyword, 'select') + assert tokens[1] == (Comment.Single, text) + assert tokens[-2] == (Keyword, 'select') + + +@pytest.mark.parametrize( + 'text', + ( + '/**/a', '/*a*b/c*/a', '/*\nabc\n*/a', + '/* /* */a' + ) +) +def test_comments_multi_line(lexer, text): + tokens = list(lexer.get_tokens(text)) + assert all(token[0] == Comment.Multiline for token in tokens[:-2]) + assert ''.join(token[1] for token in tokens).strip() == text.strip() + + # Validate nested comments are not supported. + assert tokens[-2][0] != Comment.Multiline + + +@pytest.mark.parametrize( + 'text', ('BKA', 'SEMIJOIN')) +def test_optimizer_hints(lexer, text): + good = '/*+ ' + text + '(), */' + ignore = '/* ' + text + ' */' + bad1 = '/*+ a' + text + '() */' + bad2 = '/*+ ' + text + 'a */' + assert (Comment.Preproc, text) in lexer.get_tokens(good) + assert (Comment.Preproc, text) not in lexer.get_tokens(ignore) + assert (Comment.Preproc, text) not in lexer.get_tokens(bad1) + assert (Comment.Preproc, text) not in lexer.get_tokens(bad2) + + +@pytest.mark.parametrize( + 'text, expected_types', + ( + # SET exceptions + ('SET', (Keyword,)), + ('SET abc = 1;', (Keyword,)), + ('SET @abc = 1;', (Keyword,)), + ('CHARACTER SET latin1', (Keyword, Text, Keyword)), + ('SET("r", "g", "b")', (Keyword.Type, Punctuation)), + ('SET ("r", "g", "b")', (Keyword.Type, Text, Punctuation)), + ), +) +def test_exceptions(lexer, text, expected_types): + tokens = list(lexer.get_tokens(text))[:len(expected_types)] + assert all(t[0] == e for t, e in zip(tokens, expected_types)) + + +@pytest.mark.parametrize( + 'text', + ( + 'SHOW', 'CREATE', 'ALTER', 'DROP', + 'SELECT', 'INSERT', 'UPDATE', 'DELETE', + 'WHERE', 'GROUP', 'ORDER', 'BY', 'AS', + 'DISTINCT', 'JOIN', 'WITH', 'RECURSIVE', + 'PARTITION', 'NTILE', 'MASTER_PASSWORD', 'XA', + 'REQUIRE_TABLE_PRIMARY_KEY_CHECK', 'STREAM', + ), +) +def test_keywords(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Keyword, text) + + +@pytest.mark.parametrize( + 'text', + ( + # Standard + 'INT(', 'VARCHAR(', 'ENUM(', 'DATETIME', 'GEOMETRY', 'POINT', 'JSON', + # Aliases and compatibility + 'FIXED', 'MEDIUMINT', 'INT3', 'REAL', 'SERIAL', + 'LONG', 'NATIONAL', 'PRECISION', 'VARYING', + ), +) +def test_data_types(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Keyword.Type, text.strip('(')) + + +@pytest.mark.parametrize( + 'text', + ( + # Common + 'CAST', 'CONCAT_WS', 'DAYNAME', 'IFNULL', 'NOW', 'SUBSTR', + # Less common + 'CAN_ACCESS_COLUMN', 'JSON_CONTAINS_PATH', 'ST_GEOMFROMGEOJSON', + ), +) +def test_functions(lexer, text): + assert list(lexer.get_tokens(text + '('))[0] == (Name.Function, text) + assert list(lexer.get_tokens(text + ' ('))[0] == (Name.Function, text) + + +@pytest.mark.parametrize( + 'text', + ( + 'abc_$123', '上市年限', 'ひらがな', + '`a`', '`上市年限`', '`ひらがな`', '`select`', '`concat(`', + '````', r'`\``', r'`\\`', + '`-- `', '`/*`', '`#`', + ), +) +def test_schema_object_names(lexer, text): + tokens = list(lexer.get_tokens(text))[:-1] + assert all(token[0] == Name for token in tokens) + assert ''.join(token[1] for token in tokens) == text + + +@pytest.mark.parametrize( + 'text', + ('+', '*', '/', '%', '&&', ':=', '!', '<', '->>', '^', '|', '~'), +) +def test_operators(lexer, text): + assert list(lexer.get_tokens(text))[0] == (Operator, text) + + +@pytest.mark.parametrize( + 'text, expected_types', + ( + ('abc.efg', (Name, Punctuation, Name)), + ('abc,efg', (Name, Punctuation, Name)), + ('MAX(abc)', (Name.Function, Punctuation, Name, Punctuation)), + ('efg;', (Name, Punctuation)), + ), +) +def test_punctuation(lexer, text, expected_types): + tokens = list(lexer.get_tokens(text))[:len(expected_types)] + assert all(t[0] == e for t, e in zip(tokens, expected_types)) diff --git a/tests/test_objectiveclexer.py b/tests/test_objectiveclexer.py index 54f31db4..31f833cf 100644 --- a/tests/test_objectiveclexer.py +++ b/tests/test_objectiveclexer.py @@ -3,7 +3,7 @@ Basic CLexer Test ~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_perllexer.py b/tests/test_perllexer.py index 8849bacf..6ec29993 100644 --- a/tests/test_perllexer.py +++ b/tests/test_perllexer.py @@ -3,7 +3,7 @@ Pygments regex lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_php.py b/tests/test_php.py index 1660183a..890f88c0 100644 --- a/tests/test_php.py +++ b/tests/test_php.py @@ -3,7 +3,7 @@ PHP Tests ~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_praat.py b/tests/test_praat.py index 61ddfd57..e3997671 100644 --- a/tests/test_praat.py +++ b/tests/test_praat.py @@ -3,7 +3,7 @@ Praat lexer tests ~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_promql.py b/tests/test_promql.py new file mode 100644 index 00000000..cd02a57a --- /dev/null +++ b/tests/test_promql.py @@ -0,0 +1,310 @@ +# -*- coding: utf-8 -*- +""" + Basic PromQLLexer Tests + ~~~~~~~~~~~~~~~~~~~~~~~ + + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import pytest + +from pygments.lexers import PromQLLexer +from pygments.token import Token + + +@pytest.fixture(scope="module") +def lexer(): + yield PromQLLexer() + + +def test_metric(lexer): + fragment = u"go_gc_duration_seconds" + tokens = [ + (Token.Name.Variable, "go_gc_duration_seconds"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_metric_one_label(lexer): + fragment = u'go_gc_duration_seconds{instance="localhost:9090"}' + tokens = [ + (Token.Name.Variable, "go_gc_duration_seconds"), + (Token.Punctuation, "{"), + (Token.Name.Label, "instance"), + (Token.Operator, "="), + (Token.Punctuation, '"'), + (Token.Literal.String, "localhost:9090"), + (Token.Punctuation, '"'), + (Token.Punctuation, "}"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_metric_multiple_labels(lexer): + fragment = u'go_gc_duration_seconds{instance="localhost:9090",job="alertmanager"}' + tokens = [ + (Token.Name.Variable, "go_gc_duration_seconds"), + (Token.Punctuation, "{"), + (Token.Name.Label, "instance"), + (Token.Operator, "="), + (Token.Punctuation, '"'), + (Token.Literal.String, "localhost:9090"), + (Token.Punctuation, '"'), + (Token.Punctuation, ","), + (Token.Name.Label, "job"), + (Token.Operator, "="), + (Token.Punctuation, '"'), + (Token.Literal.String, "alertmanager"), + (Token.Punctuation, '"'), + (Token.Punctuation, "}"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_metric_multiple_labels_with_spaces(lexer): + fragment = u'go_gc_duration_seconds{ instance="localhost:9090", job="alertmanager" }' + tokens = [ + (Token.Name.Variable, "go_gc_duration_seconds"), + (Token.Punctuation, "{"), + (Token.Text.Whitespace, " "), + (Token.Name.Label, "instance"), + (Token.Operator, "="), + (Token.Punctuation, '"'), + (Token.Literal.String, "localhost:9090"), + (Token.Punctuation, '"'), + (Token.Punctuation, ","), + (Token.Text.Whitespace, " "), + (Token.Name.Label, "job"), + (Token.Operator, "="), + (Token.Punctuation, '"'), + (Token.Literal.String, "alertmanager"), + (Token.Punctuation, '"'), + (Token.Text.Whitespace, " "), + (Token.Punctuation, "}"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_expression_and_comment(lexer): + fragment = u'go_gc_duration_seconds{instance="localhost:9090"} # single comment\n' + tokens = [ + (Token.Name.Variable, "go_gc_duration_seconds"), + (Token.Punctuation, "{"), + (Token.Name.Label, "instance"), + (Token.Operator, "="), + (Token.Punctuation, '"'), + (Token.Literal.String, "localhost:9090"), + (Token.Punctuation, '"'), + (Token.Punctuation, "}"), + (Token.Text.Whitespace, " "), + (Token.Comment.Single, "# single comment"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_function_delta(lexer): + fragment = u'delta(cpu_temp_celsius{host="zeus"}[2h])' + tokens = [ + (Token.Keyword.Reserved, "delta"), + (Token.Operator, "("), + (Token.Name.Variable, "cpu_temp_celsius"), + (Token.Punctuation, "{"), + (Token.Name.Label, "host"), + (Token.Operator, "="), + (Token.Punctuation, '"'), + (Token.Literal.String, "zeus"), + (Token.Punctuation, '"'), + (Token.Punctuation, "}"), + (Token.Punctuation, "["), + (Token.Literal.String, "2h"), + (Token.Punctuation, "]"), + (Token.Operator, ")"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_function_sum_with_args(lexer): + fragment = u"sum by (app, proc) (instance_memory_usage_bytes)\n" + tokens = [ + (Token.Keyword, "sum"), + (Token.Text.Whitespace, " "), + (Token.Keyword, "by"), + (Token.Text.Whitespace, " "), + (Token.Operator, "("), + (Token.Name.Variable, "app"), + (Token.Punctuation, ","), + (Token.Text.Whitespace, " "), + (Token.Name.Variable, "proc"), + (Token.Operator, ")"), + (Token.Text.Whitespace, " "), + (Token.Operator, "("), + (Token.Name.Variable, "instance_memory_usage_bytes"), + (Token.Operator, ")"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_function_multi_line(lexer): + fragment = u"""label_replace( + sum by (instance) ( + irate(node_disk_read_bytes_total[2m]) + ) / 1024 / 1024, + "device", + 'disk', + "instance", + ".*" +) +""" + tokens = [ + (Token.Keyword.Reserved, "label_replace"), + (Token.Operator, "("), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Keyword, "sum"), + (Token.Text.Whitespace, " "), + (Token.Keyword, "by"), + (Token.Text.Whitespace, " "), + (Token.Operator, "("), + (Token.Name.Variable, "instance"), + (Token.Operator, ")"), + (Token.Text.Whitespace, " "), + (Token.Operator, "("), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Keyword.Reserved, "irate"), + (Token.Operator, "("), + (Token.Name.Variable, "node_disk_read_bytes_total"), + (Token.Punctuation, "["), + (Token.Literal.String, "2m"), + (Token.Punctuation, "]"), + (Token.Operator, ")"), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Operator, ")"), + (Token.Text.Whitespace, " "), + (Token.Operator, "/"), + (Token.Text.Whitespace, " "), + (Token.Literal.Number.Integer, "1024"), + (Token.Text.Whitespace, " "), + (Token.Operator, "/"), + (Token.Text.Whitespace, " "), + (Token.Literal.Number.Integer, "1024"), + (Token.Punctuation, ","), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Punctuation, '"'), + (Token.Literal.String, "device"), + (Token.Punctuation, '"'), + (Token.Punctuation, ","), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Punctuation, "'"), + (Token.Literal.String, "disk"), + (Token.Punctuation, "'"), + (Token.Punctuation, ","), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Punctuation, '"'), + (Token.Literal.String, "instance"), + (Token.Punctuation, '"'), + (Token.Punctuation, ","), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Punctuation, '"'), + (Token.Literal.String, ".*"), + (Token.Punctuation, '"'), + (Token.Text.Whitespace, "\n"), + (Token.Operator, ")"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens + + +def test_function_multi_line_with_offset(lexer): + fragment = u"""label_replace( + avg by(instance) + (irate(node_cpu_seconds_total{mode = "idle"}[5m] offset 3s) + ) * 100, + "device", + "cpu", + "instance", + ".*" +)""" + tokens = [ + (Token.Keyword.Reserved, "label_replace"), + (Token.Operator, "("), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Keyword, "avg"), + (Token.Text.Whitespace, " "), + (Token.Keyword, "by"), + (Token.Operator, "("), + (Token.Name.Variable, "instance"), + (Token.Operator, ")"), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Operator, "("), + (Token.Keyword.Reserved, "irate"), + (Token.Operator, "("), + (Token.Name.Variable, "node_cpu_seconds_total"), + (Token.Punctuation, "{"), + (Token.Name.Label, "mode"), + (Token.Text.Whitespace, " "), + (Token.Operator, "="), + (Token.Text.Whitespace, " "), + (Token.Punctuation, '"'), + (Token.Literal.String, "idle"), + (Token.Punctuation, '"'), + (Token.Punctuation, "}"), + (Token.Punctuation, "["), + (Token.Literal.String, "5m"), + (Token.Punctuation, "]"), + (Token.Text.Whitespace, " "), + (Token.Keyword, "offset"), + (Token.Text.Whitespace, " "), + (Token.Literal.String, "3s"), + (Token.Operator, ")"), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Operator, ")"), + (Token.Text.Whitespace, " "), + (Token.Operator, "*"), + (Token.Text.Whitespace, " "), + (Token.Literal.Number.Integer, "100"), + (Token.Punctuation, ","), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Punctuation, '"'), + (Token.Literal.String, "device"), + (Token.Punctuation, '"'), + (Token.Punctuation, ","), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Punctuation, '"'), + (Token.Literal.String, "cpu"), + (Token.Punctuation, '"'), + (Token.Punctuation, ","), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Punctuation, '"'), + (Token.Literal.String, "instance"), + (Token.Punctuation, '"'), + (Token.Punctuation, ","), + (Token.Text.Whitespace, "\n"), + (Token.Text.Whitespace, " "), + (Token.Punctuation, '"'), + (Token.Literal.String, ".*"), + (Token.Punctuation, '"'), + (Token.Text.Whitespace, "\n"), + (Token.Operator, ")"), + (Token.Text.Whitespace, "\n"), + ] + assert list(lexer.get_tokens(fragment)) == tokens diff --git a/tests/test_properties.py b/tests/test_properties.py index 25368d93..0cdd0e41 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -3,7 +3,7 @@ Properties Tests ~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_python.py b/tests/test_python.py index 23bb6ed1..8e53677b 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -3,7 +3,7 @@ Python Tests ~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_qbasiclexer.py b/tests/test_qbasiclexer.py index 3c64d69e..fb721437 100644 --- a/tests/test_qbasiclexer.py +++ b/tests/test_qbasiclexer.py @@ -3,7 +3,7 @@ Tests for QBasic ~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_r.py b/tests/test_r.py index 6dcc78e3..2814acd7 100644 --- a/tests/test_r.py +++ b/tests/test_r.py @@ -3,7 +3,7 @@ R Tests ~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_regexlexer.py b/tests/test_regexlexer.py index 4e832361..8e55696c 100644 --- a/tests/test_regexlexer.py +++ b/tests/test_regexlexer.py @@ -3,7 +3,7 @@ Pygments regex lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_regexopt.py b/tests/test_regexopt.py index 20d48dda..2d210c9b 100644 --- a/tests/test_regexopt.py +++ b/tests/test_regexopt.py @@ -3,7 +3,7 @@ Tests for pygments.regexopt ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_rtf_formatter.py b/tests/test_rtf_formatter.py index 23d6695f..6f60d06e 100644 --- a/tests/test_rtf_formatter.py +++ b/tests/test_rtf_formatter.py @@ -3,7 +3,7 @@ Pygments RTF formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_ruby.py b/tests/test_ruby.py index a6da4bf9..86a9ee77 100644 --- a/tests/test_ruby.py +++ b/tests/test_ruby.py @@ -3,7 +3,7 @@ Basic RubyLexer Test ~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_shell.py b/tests/test_shell.py index 753a37e3..79f78b3a 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -3,7 +3,7 @@ Basic Shell Tests ~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -179,6 +179,24 @@ def test_powershell_session(lexer_powershell_session): ] assert list(lexer_powershell_session.get_tokens(fragment)) == tokens + fragment = u'PS> Get-ChildItem\n' + tokens = [ + (Token.Name.Builtin, u''), + (Token.Generic.Prompt, u'PS> '), + (Token.Name.Builtin, u'Get-ChildItem'), + (Token.Text, u'\n') + ] + assert list(lexer_powershell_session.get_tokens(fragment)) == tokens + + fragment = u'PS > Get-ChildItem\n' + tokens = [ + (Token.Name.Builtin, u''), + (Token.Generic.Prompt, u'PS > '), + (Token.Name.Builtin, u'Get-ChildItem'), + (Token.Text, u'\n') + ] + assert list(lexer_powershell_session.get_tokens(fragment)) == tokens + def test_powershell_remoting_session(lexer_powershell_session): fragment = u'[Long-NetBIOS-Hostname]: PS C:\\> Get-ChildItem\n' diff --git a/tests/test_smarty.py b/tests/test_smarty.py index 2d172559..2b45abee 100644 --- a/tests/test_smarty.py +++ b/tests/test_smarty.py @@ -3,7 +3,7 @@ Basic SmartyLexer Test ~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_sql.py b/tests/test_sql.py index efd63be6..ead06de7 100644 --- a/tests/test_sql.py +++ b/tests/test_sql.py @@ -3,7 +3,7 @@ Pygments SQL lexers tests ~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_terminal_formatter.py b/tests/test_terminal_formatter.py index 02076f19..e08a3b21 100644 --- a/tests/test_terminal_formatter.py +++ b/tests/test_terminal_formatter.py @@ -3,7 +3,7 @@ Pygments terminal formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_textfmts.py b/tests/test_textfmts.py index 5a4f56c4..f4ce9b33 100644 --- a/tests/test_textfmts.py +++ b/tests/test_textfmts.py @@ -3,7 +3,7 @@ Basic Tests for textfmts ~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_token.py b/tests/test_token.py index 11e4d375..6fe99014 100644 --- a/tests/test_token.py +++ b/tests/test_token.py @@ -3,7 +3,7 @@ Test suite for the token module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_unistring.py b/tests/test_unistring.py index 3a0acec9..5df61e69 100644 --- a/tests/test_unistring.py +++ b/tests/test_unistring.py @@ -3,7 +3,7 @@ Test suite for the unistring module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_using_api.py b/tests/test_using_api.py index b5310aa8..e7932a7b 100644 --- a/tests/test_using_api.py +++ b/tests/test_using_api.py @@ -3,7 +3,7 @@ Pygments tests for using() ~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_util.py b/tests/test_util.py index 94985a25..81b3b054 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -3,7 +3,7 @@ Test suite for the util module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_whiley.py b/tests/test_whiley.py index 84fef25b..e844dafb 100644 --- a/tests/test_whiley.py +++ b/tests/test_whiley.py @@ -3,7 +3,7 @@ Whiley Test ~~~~~~~~~~~ - :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ |