Skip to content

Commit 2bc5cd9

Browse files
Merge pull request #127 from VincentLanglet/addTests
🚨 Add tests
2 parents fae0a11 + 2ee4767 commit 2bc5cd9

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{ 1..10 }}
2+
{{ foo.bar }}
3+
{{ (foo) }}
4+
{{ {'a': 'b', 'c': 'd'} }}
5+
{% set a = [1, 2, 4] %}
6+
{{ a|trans }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace TwigCS\Tests\Ruleset\Generic\PunctuationSpacing;
6+
7+
use TwigCS\Ruleset\Generic\PunctuationSpacingSniff;
8+
use TwigCS\Tests\Ruleset\AbstractSniffTest;
9+
10+
/**
11+
* Class PunctuationSpacingTest
12+
*/
13+
class PunctuationSpacingTest extends AbstractSniffTest
14+
{
15+
/**
16+
* @return void
17+
*/
18+
public function testSniff(): void
19+
{
20+
$this->checkSniff(new PunctuationSpacingSniff(), [
21+
[3 => 4],
22+
[3 => 10],
23+
[4 => 4],
24+
[4 => 10],
25+
[4 => 16],
26+
[4 => 22],
27+
[4 => 28],
28+
[5 => 12],
29+
[5 => 16],
30+
[5 => 20],
31+
[5 => 24],
32+
[6 => 6],
33+
[6 => 6],
34+
]);
35+
}
36+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{ 1..10 }}
2+
{{ foo.bar }}
3+
{{ ( foo ) }}
4+
{{ { 'a' : 'b' , 'c' : 'd' } }}
5+
{% set a = [ 1 , 2 , 4 ] %}
6+
{{ a | trans }}

0 commit comments

Comments
 (0)