Add decnum workflow to test building without decNumber support

This commit is contained in:
itchyny authored and Nico Williams committed 2023-07-24 11:53:51 -05:00
1 parent c4d5ba954d
commit 5300fbda58
2 files changed
+35 -4

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
name: decnum
on:
push:
branches:
- master
pull_request:
jobs:
disabled:
runs-on: ubuntu-22.04
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
submodules: true
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y automake autoconf libtool
- name: Build
run: |
autoreconf -i
./configure \
--disable-docs \
--disable-maintainer-mode \
--disable-decnum
make -j"$(nproc)"
file ./jq
- name: Test
run: |
diff <(echo 100000000000000000000 | ./jq) <(echo 1e+20)
git diff --exit-code
+3 -4
View File
@@ -46,10 +46,6 @@
#include "jv_unicode.h"
#include "util.h"
#include "jv_dtoa.h"
#include "jv_dtoa_tsd.h"
#include "jv_type_private.h"
/*
* Internal refcounting helpers
*/
@@ -200,6 +196,9 @@ static void jvp_invalid_free(jv x) {
*/
#ifdef USE_DECNUM
#include "jv_dtoa.h"
#include "jv_dtoa_tsd.h"
// we will manage the space for the struct
#define DECNUMDIGITS 1
#include "decNumber/decNumber.h"