-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from gmaxlev/website
Website
- Loading branch information
Showing
30 changed files
with
15,648 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve("@docusaurus/core/lib/babel/preset")], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
sidebar_position: 7 | ||
--- | ||
|
||
# Aliasing | ||
|
||
Aliasing is a way of specifying multiple names for a single value. Multiple names do not change the combinatorial complexity of the model. No matter how many names a value has, they are treated as one entity. The only difference will be in the output; any test case that would normally have that one value will have one of its names instead. Names are rotated among the test cases. | ||
|
||
:::info | ||
Read [PICT documentation](https://github.com/Microsoft/pict/blob/main/doc/pict.md#aliasing) to get more information about aliasing. | ||
::: | ||
|
||
There is a special function `alias` that can be used to create aliases for values. It can be used with both the `pict` and `strings` API functions. | ||
|
||
```js | ||
import { pict, alias } from "pict-node"; | ||
|
||
const model = [ | ||
{ | ||
key: "os", | ||
values: ["Win7", "Win8", alias(["Win10", "Windows10"])], | ||
}, | ||
{ | ||
key: "platform", | ||
values: ["x86", "x64", "arm"], | ||
}, | ||
{ | ||
key: "ram", | ||
values: [1, 4, 64], | ||
}, | ||
]; | ||
|
||
const cases = await pict({ model }); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
# Constraints | ||
|
||
In practice, you might want to exclude some of the generated test cases because certain parameters can't exist together. You can use constraints and their powerful syntax for this. | ||
|
||
:::info | ||
Read [PICT documentation](https://github.com/Microsoft/pict/blob/main/doc/pict.md#constraints) to get more information about constraints. | ||
::: | ||
|
||
Constraints are only applicable when using the strings function, which only accepts string values and provides additional options: | ||
|
||
- `aliasSeparator` - the separator used for aliases (default: `|`) | ||
- `valueSeparator` - the separator used for values (default: `,`) | ||
- `negativePrefix` - the prefix used for negative values (default: `~`) | ||
- `caseSensitive` - [case sensitive](https://github.com/Microsoft/pict/blob/main/doc/pict.md#case-sensitiveness) (default: `false`) | ||
|
||
:::warning | ||
Be aware that the characters used for `aliasSeparator`, `valueSeparator`, and `negativePrefix` cannot be used in your values. If you use them, you must replace them using the second argument (options). | ||
::: | ||
|
||
```js | ||
import { strings } from "pict-node"; | ||
|
||
const model = [ | ||
{ | ||
key: "type", | ||
values: ["Primary", "Logical", "Single"], | ||
}, | ||
{ | ||
key: "size", | ||
values: ["10", "100", "500", "1000", "5000", "10000", "40000"], | ||
}, | ||
{ | ||
key: "fileSystem", | ||
values: ["FAT", "FAT32", "NTFS"], | ||
}, | ||
]; | ||
|
||
const constraints = [ | ||
'IF [fileSystem] = "FAT" THEN [Size] <= 4096;', | ||
'IF [fileSystem] = "FAT32" THEN [Size] <= 32000;', | ||
]; | ||
|
||
const cases = await strings( | ||
{ | ||
model, | ||
constraints, | ||
}, | ||
{ | ||
caseSensitive: true, | ||
} | ||
); | ||
``` | ||
|
||
If you need to use values of different types, you can use the `pict` function instead of the `strings` function. This way, you can specify any type you want for the values of your model. |
Oops, something went wrong.