Documentation

FT112 (micro failure)

Back to documentation index
{
  "@context": "https://nxdlang.org/schema",
  "doc_id": "PT112",
  "title": "PT112 - Intentional Failures",
  "description": "Intentional Test Failures",
  "layer": "Passed Tests",
  "category": "Passed Tests - Nim",
  "keywords": [Nim, Pass, Test],
  "doc_version": "1.0",
  "status": "active"
}

# FT112 (micro failure)

### NXD Sample:

```nxd
MODULE TEST

FUNC MAIN()
    CONST LIMIT SET 10
    LET X SET -5

    PRINTLN(LIMIT)
    PRINTLN(X)
```

### Result:

PASS

### Expected Output:

FAIL -

### Expected Rejection Stage:

[ ] Lexer
[ ] Parser
[ ] AST
[ ] IR
[ ] Semantics
[ ] Backend

### Actual Output:

```json
{
  "module": {
    "name": "TEST",
    "imports": []
  },
  "types": [],
  "traits": [],
  "impls": [],
  "functions": [
    {
      "name": "MAIN",
      "params": [],
      "return_type": null,
      "body": [
        {
          "Const": {
            "name": "LIMIT",
            "value": {
              "Literal": {
                "Int": 10
              }
            }
          }
        },
        {
          "Let": {
            "name": "X",
            "value": {
              "Literal": {
                "Int": 5
              }
            }
          }
        },
        {
          "Expr": {
            "Call": {
              "func": "PRINTLN",
              "args": [
                {
                  "Var": "LIMIT"
                }
              ]
            }
          }
        },
        {
          "Expr": {
            "Call": {
              "func": "PRINTLN",
              "args": [
                {
                  "Var": "X"
                }
              ]
            }
          }
        }
      ]
    }
  ],
  "statements": []
}
```

```nim
# test


proc main() =
  let limit = 10
  var x = 5
  println(limit)
  println(x)

```

### Notes: