Skip to content

Commit

Permalink
Add advanced scenarios to invocation. #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrandvd authored Jan 11, 2024
1 parent 94b3388 commit 8977bdc
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/invocation-scenario-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,38 @@ However, `SemanticSimilar` is not the only assertion method. There are many more

You can see the full list of CHECK statements here: [CHECK Statement spec](https://github.com/mehrandvd/skunit/blob/main/docs/check-statements-spec.md).

## Advanced Scenario Features

### Flexible Use of Hashtags
When defining skUnit statements such as `# SCENARIO`, `# PARAMETER`, and so on, you have the freedom to use as many hashtags as you wish. There's no strict rule that mandates a specific count of hashtags for each statement. This flexibility allows you to format your markdown in a way that enhances readability for you. However, as a best practice, we suggest adhering to the recommended usage to maintain a clear and comprehensible hierarchy.

### Unique Identifiers
In certain uncommon instances, the data may contain skUnit expressions that could disrupt the parsing of the scenario. For instance, let's consider a scenario with two parameters: `input` and `options`. If the first parameter contains a markdown value that disrupts parsing, it could pose a problem:

```md
# SCENARIO

## PARAMETER input
This block is a markdown itself that includes this exact section:
## PARAMETER hello
This could lead skUnit to mistakenly identify it as a `parameter`, which it isn't.

## PARAMETER options
happy, angry
```

To handle these exceptional cases, you can employ an identifier in your statements, like so:

```md
# sk SCENARIO

## sk PARAMETER input
This block is a markdown itself that includes this exact section:
## PARAMETER hello
This could lead skUnit to mistakenly identify it as a `parameter`, which it isn't.

## sk PARAMETER options
happy, angry
```

In this example, we used `sk` as the identifier. However, you can use any identifier of your choice, such as `~`, `*`, etc. The parser will recognize whatever you use in the first statement as the unique identifier for the statements.

0 comments on commit 8977bdc

Please sign in to comment.