Skip to content

Commit f37648d

Browse files
authored
Fix tests (#120)
1 parent a51f2e9 commit f37648d

File tree

11 files changed

+20
-18
lines changed

11 files changed

+20
-18
lines changed

.github/workflows/Test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, macos-latest]
17-
node-version: ["lts/*", "node"]
17+
node-version: ["lts/*"]
1818

1919
steps:
2020
- name: Checkout code
@@ -58,7 +58,7 @@ jobs:
5858
strategy:
5959
matrix:
6060
node-version: ["lts/*"]
61-
arch: ["x64", "arm64"]
61+
arch: ["x64"]
6262
include:
6363
- node-version: "22"
6464
arch: "x86"

src/Async/AddDictionaryWorker.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#include <napi.h>
22
#include <hunspell.hxx>
3+
#include <string>
34
#include "Worker.cc"
45

56
class AddDictionaryWorker : public Worker {
67
public:
78
AddDictionaryWorker(
89
HunspellContext* context,
910
Napi::Promise::Deferred d,
10-
const char* dictionary)
11-
: Worker(context, d), dictionary(dictionary) {}
11+
std::string dictionary)
12+
: Worker(context, d), dictionary(std::move(dictionary)) {}
1213

1314
void Execute() {
1415
// Worker thread; don't use N-API here
1516
context->lockWrite();
16-
context->instance->add_dic(dictionary);
17+
context->instance->add_dic(dictionary.c_str());
1718
context->unlockWrite();
1819
}
1920

@@ -24,5 +25,5 @@ class AddDictionaryWorker : public Worker {
2425
}
2526

2627
private:
27-
const char* dictionary;
28+
std::string dictionary;
2829
};

src/Async/AddWithAffixWorker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class AddWithAffixWorker : public Worker {
99
Napi::Promise::Deferred d,
1010
std::string word,
1111
std::string example)
12-
: Worker(context, d), word(word), example(example) {}
12+
: Worker(context, d), word(std::move(word)), example(std::move(example)) {}
1313

1414
void Execute() {
1515
// Worker thread; don't use N-API here

src/Async/AddWorker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class AddWorker : public Worker {
88
HunspellContext* context,
99
Napi::Promise::Deferred d,
1010
std::string word)
11-
: Worker(context, d), word(word) {}
11+
: Worker(context, d), word(std::move(word)) {}
1212

1313
void Execute() {
1414
// Worker thread; don't use N-API here

src/Async/AnalyzeWorker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class AnalyzeWorker : public Worker {
88
HunspellContext* context,
99
Napi::Promise::Deferred d,
1010
std::string word)
11-
: Worker(context, d), word(word) {}
11+
: Worker(context, d), word(std::move(word)) {}
1212

1313
void Execute() {
1414
// Worker thread; don't use N-API here

src/Async/GenerateWorker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GenerateWorker : public Worker {
99
Napi::Promise::Deferred d,
1010
std::string word,
1111
std::string example)
12-
: Worker(context, d), word(word), example(example) {}
12+
: Worker(context, d), word(std::move(word)), example(std::move(example)) {}
1313

1414
void Execute() {
1515
// Worker thread; don't use N-API here

src/Async/RemoveWorker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class RemoveWorker : public Worker {
88
HunspellContext* context,
99
Napi::Promise::Deferred d,
1010
std::string word)
11-
: Worker(context, d), word(word) {}
11+
: Worker(context, d), word(std::move(word)) {}
1212

1313
void Execute() {
1414
// Worker thread; don't use N-API here

src/Async/SpellWorker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class SpellWorker : public Worker {
88
HunspellContext* context,
99
Napi::Promise::Deferred d,
1010
std::string word)
11-
: Worker(context, d), word(word) {}
11+
: Worker(context, d), word(std::move(word)) {}
1212

1313
void Execute() {
1414
// Worker thread; don't use N-API here

src/Async/StemWorker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class StemWorker : public Worker {
88
HunspellContext* context,
99
Napi::Promise::Deferred d,
1010
std::string word)
11-
: Worker(context, d), word(word) {}
11+
: Worker(context, d), word(std::move(word)) {}
1212

1313
void Execute() {
1414
// Worker thread; don't use N-API here

src/Async/SuggestWorker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class SuggestWorker : public Worker {
88
HunspellContext* context,
99
Napi::Promise::Deferred d,
1010
std::string word)
11-
: Worker(context, d), word(word) {}
11+
: Worker(context, d), word(std::move(word)) {}
1212

1313
void Execute() {
1414
// Worker thread; don't use N-API here

0 commit comments

Comments
 (0)