Skip to content

Commit

Permalink
add empty line code actions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsemakula committed Feb 4, 2024
1 parent f9e21fe commit 169eaf4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/suite/actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ const ACTION_TESTS: Array<TestGroup> = [
{ text: '#[ink(message)]', isSnippet: true, startPos: [214, 9], endPos: [214, 9] },
],
},
{
name: 'root level empty line',
// i.e. empty line between `#![cfg_attr(not(feature = "std"), no_std, no_main)]` and `#[ink::contract]`
params: { startPos: [1, 0], endPos: [1, 0] },
results: [
{ text: '#[ink::trait_definition]', isSnippet: true, startPos: [1, 0], endPos: [1, 0] },
{ text: '#[ink::chain_extension]', isSnippet: true, startPos: [1, 0], endPos: [1, 0] },
{ text: '#[ink::storage_item]', isSnippet: true, startPos: [1, 0], endPos: [1, 0] },
{ text: 'impl ink::env::Environment for ', isSnippet: true, startPos: [1, 0], endPos: [1, 0] },
],
},
{
name: '#[ink(storage)]',
params: { startPos: [7, 4], endPos: [7, 4] },
Expand Down Expand Up @@ -105,6 +116,12 @@ const ACTION_TESTS: Array<TestGroup> = [
{ text: '#[ink(topic)]', isSnippet: true, startPos: [27, 23], endPos: [27, 23] },
],
},
{
name: 'mod level empty line',
// i.e. empty line between `Erc20` storage struct and `Transfer` event struct.
params: { startPos: [18, 0], endPos: [18, 0] },
results: [{ text: '#[ink(event)]', isSnippet: true, startPos: [18, 0], endPos: [18, 0] }],
},
{
name: 'impl Erc20 {',
params: { startPos: [53, 4] },
Expand Down Expand Up @@ -157,6 +174,15 @@ const ACTION_TESTS: Array<TestGroup> = [
{ text: '#[ink(selector=${1:1})]', startPos: [74, 8], endPos: [74, 8] },
],
},
{
name: 'impl level empty line',
// i.e. empty line between `new` constructor fn and `total_supply` message fn.
params: { startPos: [71, 0], endPos: [71, 0] },
results: [
{ text: '#[ink(constructor)]', isSnippet: true, startPos: [71, 0], endPos: [71, 0] },
{ text: '#[ink(message)]', isSnippet: true, startPos: [71, 0], endPos: [71, 0] },
],
},
{
name: 'mod tests {',
params: { startPos: [217, 4] },
Expand Down

0 comments on commit 169eaf4

Please sign in to comment.