Skip to content

Commit dc9205d

Browse files
committed
Add test/compatibility/README.md file
1 parent fccebb4 commit dc9205d

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

test/compatibility/README.md

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,31 @@ This directory contains tools for testing HyperFormula's compatibility with Exce
44

55
## Overview
66

7-
The compatibility test suite reads Excel (.xlsx) files, evaluates their formulas using HyperFormula, and compares the results against Excel's calculated values to detect discrepancies.
7+
This compatibiloty testing tool performs the following steps for each .xlsx in `test_data/` directory:
8+
1. read both formulas and calculated values from the XLSX file
9+
2. evaluate the formulas using HyperFormula
10+
3. compare the HyperFormula's results against the original values
11+
4. report differences
812

913
## Structure
1014

1115
- **`test-compatibility.sh`** - Main test runner that processes all Excel files in `test_data/`
12-
- **`compare-evaluation-results.ts`** - Core comparison tool that:
13-
- Extracts formulas and values from Excel files
14-
- Evaluates formulas using HyperFormula
15-
- Compares results (formulas and values)
16-
- Reports differences with tolerance for floating-point precision
16+
- **`compare-evaluation-results.ts`** - Core comparison tool
1717
- **`test_data/`** - Collection of Excel test files covering various features
1818

19-
## Usage
19+
## Running
2020

2121
Run all compatibility tests:
2222
```bash
23-
bash test/compatibility/test-compatibility.sh
23+
npm run test:compatibility
2424
```
2525

2626
Test a specific Excel file:
2727
```bash
2828
ts-node --transpile-only -O '{"module":"commonjs"}' test/compatibility/compare-evaluation-results.ts test/compatibility/test_data/your-file.xlsx
2929
```
3030

31-
## Exit Codes
32-
33-
- **0** - All tests passed (no differences found)
34-
- **1** - Differences detected or error occurred
35-
36-
## How It Works
37-
38-
1. Reads Excel workbook and extracts formulas and pre-calculated values
39-
2. Evaluates formulas using HyperFormula with Excel-compatible configuration
40-
3. Compares:
41-
- **Formulas**: HyperFormula's serialized formulas vs. original Excel formulas
42-
- **Values**: HyperFormula's computed values vs. Excel's values
43-
4. Uses configurable epsilon (10⁻⁹) for floating-point comparisons
44-
5. Normalizes null-like values (0, '', false, null, undefined) for consistent comparison
45-
4631
## Adding Test Cases
4732

48-
Add `.xlsx` files to `test_data/`. Files starting with `~` are automatically skipped (Excel lock files).
33+
1. Create the XLSX file with both formulas and calculated values using MS Excel or Google Sheets
34+
2. Put the file into `test_data/` directory

0 commit comments

Comments
 (0)