Skip to content

Commit

Permalink
Add a lot of testcases for S4663
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-paidis-sonarsource committed Jan 26, 2023
1 parent 57dd677 commit abb445a
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 9 deletions.
Expand Up @@ -2,18 +2,42 @@

[Obsolete] // Ipsem Lorum
public class SingleLine //
// Noncompliant@-1 (inline comment)
{
// hey

// Noncompliant@-3 (inline comment)
{ // Ipsem Lorum
//
// Noncompliant@-1 (a lot of whitespace before)

// Noncompliant@-2 (a lot of whitespace before)

//
// Noncompliant@-1 (a lot of whitespace after)

// Noncompliant@-2 (a lot of whitespace after)

// *
// Ipsem Lorum
//
// Noncompliant @-1

// hey
//
//
//

//
//
// hey
//
//
//

//
//
//
// hey
//
//
//


//

Expand All @@ -36,6 +60,73 @@ public class SingleLine //
// //

// /** */

//
//
// hey
//
//
// there
//
//

//
//
//
/// text
// Noncompliant@-4

//
//
//
/*
* text
*/
// Noncompliant@-6

//
//
//
/**
* text
*/
// Noncompliant@-6

void Method()
{
// Noncompliant@+2

//
//
//
var x = 42; //
//
//
//

// Noncompliant@-5
// Noncompliant@-5

//
//
// hello
//
//
var y = 42; //
//
//
//
// there

// Noncompliant@-6

//
} //
//

// Noncompliant@-4
// Noncompliant@-4
// Noncompliant@-4
}

[Obsolete] /// Ipsem Lorum
Expand All @@ -58,6 +149,7 @@ public class SingleLineDocumentation ///
/// hey there

/// hey there
/// text
///

/// ///
Expand Down
@@ -1,25 +1,55 @@
Public Class Testcases

Public Sub Comment() '
' Noncompliant@-1 (inline comment)

' Noncompliant@-2 (inline comment)

Dim x = 42 'Ipsem Lorum
Dim y = 42 ' Ipsem Lorum
Dim z = 42 '
' Noncompliant@-1 (whitespace)

' Noncompliant@-2

Dim a = 42 '''Ipsem Lorum
Dim b = 42 ''' Ipsem Lorum
Dim c = 42 '''

'
' Noncompliant@-1 (whitespace)

' Noncompliant@-2 (whitespace)


'
'
'
' hey

' hey
'
'
'

' Noncompliant@+2

'
'
'
'

' Noncompliant@+2

'

'
'
'

' Noncompliant@-4

' *
' Ipsem Lorum
'Ipsem Lorum
'
' Noncompliant @-1

'

Expand All @@ -44,6 +74,12 @@
''

''''''

'
'
'
''' Ipsem Lorum
' Noncompliant@-4
End Sub

Public Sub DocumentationComment()
Expand Down

0 comments on commit abb445a

Please sign in to comment.