PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 216
Good morning! Here's your coding interview problem for today.

This problem was asked by Facebook.

Given a number in Roman numeral format, convert it to decimal.

The values of Roman numerals are as follows:
```
{
    'M': 1000,
    'D': 500,
    'C': 100,
    'L': 50,
    'X': 10,
    'V': 5,
    'I': 1
}
```
In addition, note that the Roman numeral system uses subtractive notation for numbers such as IV and XL.

For the input XIV, for instance, you should return 14.

Pull request:
Day216
Resolves #445.

Patch:
diff --git a/README.md b/README.md
index 7a38b7b..b9f072f 100644
--- a/README.md
+++ b/README.md
@@ -226,3 +226,4 @@ problems from
 * [Day 213](https://github.com/vaskoz/dailycodingproblem-go/issues/439)
 * [Day 214](https://github.com/vaskoz/dailycodingproblem-go/issues/441)
 * [Day 215](https://github.com/vaskoz/dailycodingproblem-go/issues/443)
+* [Day 216](https://github.com/vaskoz/dailycodingproblem-go/issues/445)
diff --git a/day216/problem.go b/day216/problem.go
new file mode 100644
index 0000000..427fa62
--- /dev/null
+++ b/day216/problem.go
@@ -0,0 +1,32 @@
+package day216
+
+var romanNumeralMap = map[rune]int{
+	'M': 1000,
+	'D': 500,
+	'C': 100,
+	'L': 50,
+	'X': 10,
+	'V': 5,
+	'I': 1,
+}
+
+// ConvertRomanNumeralToInteger converts and roman numeral string
+// into an integer.
+// Only works on non-negative integers (no decimals).
+func ConvertRomanNumeralToInteger(roman string) int {
+	var result int
+	for i := 0; i < len(roman); i++ {
+		if first := romanNumeralMap[rune(roman[i])]; i+1 < len(roman) {
+			if second := romanNumeralMap[rune(roman[i+1])]; first >= second {
+				result += first
+			} else {
+				result += second - first
+				i++
+			}
+		} else {
+			result += first
+			i++
+		}
+	}
+	return result
+}


Test patch:
diff --git a/day216/problem_test.go b/day216/problem_test.go
new file mode 100644
index 0000000..89f3ade
--- /dev/null
+++ b/day216/problem_test.go
@@ -0,0 +1,32 @@
+package day216
+
+import "testing"
+
+var testcases = []struct {
+	roman    string
+	expected int
+}{
+	{"IV", 4},
+	{"XL", 40},
+	{"XIV", 14},
+	{"MMXIX", 2019},
+	{"XVI", 16},
+	{"XMMMM", 3990},
+}
+
+func TestConvertRomanNumeralToInteger(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := ConvertRomanNumeralToInteger(tc.roman); result != tc.expected {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkConvertRomanNumeralToInteger(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			ConvertRomanNumeralToInteger(tc.roman)
+		}
+	}
+}
Repository: websockets/ws (js)

Issue:
Close frame spanning multiple packets is not handled correctly
- [x] I've searched for any related issues and avoided creating a duplicate
      issue.

#### Description
A close frame which has been split over multiple TCP packets, for example <header><payload> is not handled correctly.  The payload is never read and `conclude` event not emitted.

#### Reproducible in:

- version: 6.1.2
- Node.js version(s): 10.12
- OS version(s): Linux; Fedora 29

#### Steps to reproduce:

1. Establish a websocket session

2. Send a close frame from the server as two separate packets

#### Expected result:

1. Close frame is parsed correctly and `conclude` event is emitted from receiver

#### Actual result:

1. Close frame is not parsed and `conclude` is never emitted



Pull request:
Handle close frame which spans multiple packets
Fixes #1493 

Patch:
diff --git a/lib/receiver.js b/lib/receiver.js
index b9102011..9d301235 100644
--- a/lib/receiver.js
+++ b/lib/receiver.js
@@ -62,7 +62,7 @@ class Receiver extends stream.Writable {
    * @param {Function} cb Callback
    */
   _write(chunk, encoding, cb) {
-    if (this._opcode === 0x08) return cb();
+    if (this._opcode === 0x08 && this._state == GET_INFO) return cb();
 
     this._bufferedBytes += chunk.length;
     this._buffers.push(chunk);
@@ -454,6 +454,7 @@ class Receiver extends stream.Writable {
         this.end();
       }
 
+      this._state = GET_INFO;
       return;
     }
 


Test patch:
diff --git a/test/receiver.test.js b/test/receiver.test.js
index 6211b31a..3bc68071 100644
--- a/test/receiver.test.js
+++ b/test/receiver.test.js
@@ -34,6 +34,19 @@ describe('Receiver', function() {
     receiver.write(Buffer.from('8800', 'hex'));
   });
 
+  it('parses a close message spanning multiple writes', function(done) {
+    const receiver = new Receiver();
+
+    receiver.on('conclude', (code, data) => {
+      assert.strictEqual(code, 1000);
+      assert.strictEqual(data, 'DONE');
+      done();
+    });
+
+    receiver.write(Buffer.from('8806', 'hex'));
+    receiver.write(Buffer.from('03e8444F4E45', 'hex'));
+  });
+
   it('parses a masked text message', function(done) {
     const receiver = new Receiver();
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 22
Good morning! Here's your coding interview problem for today.

This problem was asked by Microsoft.

Given a dictionary of words and a string made up of those words (no spaces), return the original sentence in a list. If there is more than one possible reconstruction, return any of them. If there is no possible reconstruction, then return null.

For example, given the set of words 'quick', 'brown', 'the', 'fox', and the string "thequickbrownfox", you should return ['the', 'quick', 'brown', 'fox'].

Given the set of words 'bed', 'bath', 'bedbath', 'and', 'beyond', and the string "bedbathandbeyond", return either ['bed', 'bath', 'and', 'beyond] or ['bedbath', 'and', 'beyond'].

Pull request:
Day22
Resolves #53.

Patch:
diff --git a/README.md b/README.md
index 9d58811..a18d8d4 100644
--- a/README.md
+++ b/README.md
@@ -35,3 +35,4 @@ problems from
 * [Day 19 Sudoku Solver](https://github.com/vaskoz/dailycodingproblem-go/issues/47)
 * [Day 20](https://github.com/vaskoz/dailycodingproblem-go/issues/49)
 * [Day 21](https://github.com/vaskoz/dailycodingproblem-go/issues/51)
+* [Day 22](https://github.com/vaskoz/dailycodingproblem-go/issues/53)
diff --git a/day22/problem.go b/day22/problem.go
new file mode 100644
index 0000000..ca5b518
--- /dev/null
+++ b/day22/problem.go
@@ -0,0 +1,28 @@
+package day22
+
+import (
+	"errors"
+	"fmt"
+	"strings"
+)
+
+// WordSet represents a set of possible words.
+type WordSet map[string]struct{}
+
+var errNoSentencePossible = errors.New("No sentence can be built")
+
+// OriginalSentence returns the original sentence from a concatenated sentence.
+func OriginalSentence(words WordSet, noSpaces string) (string, error) {
+	if len(noSpaces) == 0 {
+		return "", nil
+	}
+	for word := range words {
+		if len(word) <= len(noSpaces) && word == noSpaces[:len(word)] {
+			rest, err := OriginalSentence(words, noSpaces[len(word):])
+			if err == nil {
+				return strings.TrimSpace(fmt.Sprintf("%s %s", word, rest)), nil
+			}
+		}
+	}
+	return "", errNoSentencePossible
+}


Test patch:
diff --git a/day22/problem_test.go b/day22/problem_test.go
new file mode 100644
index 0000000..177c2c4
--- /dev/null
+++ b/day22/problem_test.go
@@ -0,0 +1,32 @@
+package day22
+
+import "testing"
+
+var testcases = []struct {
+	words        WordSet
+	concatenated string
+	expected     string
+	expectedErr  error
+}{
+	{WordSet{"quick": struct{}{}, "brown": struct{}{}, "fox": struct{}{}, "the": struct{}{}},
+		"thequickbrownfox", "the quick brown fox", nil},
+	{WordSet{"quick": struct{}{}, "brown": struct{}{}, "fox": struct{}{}, "the": struct{}{}},
+		"thequickbrownfoxy", "", errNoSentencePossible},
+}
+
+func TestOriginalSentence(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result, err := OriginalSentence(tc.words, tc.concatenated); result != tc.expected || err != tc.expectedErr {
+			t.Errorf("Expected (%v, %v) but got (%v, %v)", tc.expected, tc.expectedErr, result, err)
+		}
+	}
+}
+
+func BenchmarkOriginalSentence(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			OriginalSentence(tc.words, tc.concatenated)
+		}
+	}
+}
Repository: ember-cli/ember-try (js)

Issue:
`ember try:ember` dies after first failed scenario with 1.0.0-beta.3
When using ember-try 1.0.0-beta.3, `ember try:ember` exits immediately after a single scenario fails, without running the remaining scenarios or outputting the summary. (0.2.23 and 1.0.0-beta.1 work as expected.)

I created a new addon as a testcase, with a single failing test in it: https://github.com/pgengler/ember-try-testcase

To reproduce:
1) Clone the test addon and run `yarn install`.
2) Run `ember try:ember`. Only the "default" scenario runs, and execution stops with an error message displayed ([see output](https://gist.github.com/pgengler/e8d617a6cf43764b31593f8eac6b247d))

To see beta-1 behavior:
1) Check out the `beta-1` branch of the test addon and run `yarn install`.
2) Run `ember try:ember`. The scenarios all run to completion. ([see output](https://gist.github.com/pgengler/04c0c2cda6a00320dfde63549220c9f4))

Pull request:
Handle non-zero exit from commands run in a way needed by execa
Fixes #197

Patch:
diff --git a/lib/utils/run.js b/lib/utils/run.js
index dbb2fab..a4e8c25 100644
--- a/lib/utils/run.js
+++ b/lib/utils/run.js
@@ -17,9 +17,8 @@ module.exports = function run(command, args, opts) {
 
   debug('spawned with execa.shell', cmdArgs, opts);
 
-  return child.then((child) => {
-    if (child.code !== 0) {
-      return Promise.reject(child.code);
-    }
+  return child.catch((error) => {
+    debug('error', error);
+    return Promise.reject(error.code);
   });
 };


Test patch:
diff --git a/test/utils/run-test.js b/test/utils/run-test.js
new file mode 100644
index 0000000..aeda1f5
--- /dev/null
+++ b/test/utils/run-test.js
@@ -0,0 +1,15 @@
+'use strict';
+
+const expect = require('chai').expect;
+
+describe('utils/run', () => {
+  it('rejects if command exits non-zero', () => {
+    let run = require('../../lib/utils/run');
+
+    return run('exit 1', [], {}).then(() => {
+      expect(true).to.equal(false, 'Should not succeed');
+    }).catch((res) => {
+      expect(res).to.equal(1, 'Should reject with exit code');
+    });
+  });
+});
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 86
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

Given a string of parentheses, write a function to compute the minimum number of parentheses to be removed to make the string valid (i.e. each open parenthesis is eventually closed).

For example, given the string `"()())()"`, you should return 1. Given the string `")("`, you should return 2, since we must remove all of them.

Pull request:
Day86
Resolves #181.

Patch:
diff --git a/README.md b/README.md
index 0d6f718..f3cf2c1 100644
--- a/README.md
+++ b/README.md
@@ -95,3 +95,4 @@ problems from
 * [Day 83](https://github.com/vaskoz/dailycodingproblem-go/issues/175)
 * [Day 84](https://github.com/vaskoz/dailycodingproblem-go/issues/177)
 * [Day 85](https://github.com/vaskoz/dailycodingproblem-go/issues/179)
+* [Day 86](https://github.com/vaskoz/dailycodingproblem-go/issues/181)
diff --git a/day86/problem.go b/day86/problem.go
new file mode 100644
index 0000000..5550781
--- /dev/null
+++ b/day86/problem.go
@@ -0,0 +1,21 @@
+package day86
+
+// MinRemovedParens calculates the minimum of parentheses to remove to make
+// a list of them valid. Each open must have a corresponding close.
+// Runs in O(N) time with O(1) space.
+func MinRemovedParens(parens string) int {
+	opens := 0
+	count := 0
+	for _, r := range parens {
+		if r == '(' {
+			opens++
+		} else if r == ')' {
+			if opens == 0 {
+				count++
+			} else {
+				opens--
+			}
+		}
+	}
+	return count + opens
+}


Test patch:
diff --git a/day86/problem_test.go b/day86/problem_test.go
new file mode 100644
index 0000000..d5068dc
--- /dev/null
+++ b/day86/problem_test.go
@@ -0,0 +1,31 @@
+package day86
+
+import "testing"
+
+var testcases = []struct {
+	input    string
+	expected int
+}{
+	{"()())()", 1},
+	{")(", 2},
+	{"((()(())))", 0},
+	{"(((()(())))", 1},
+	{"((()(()))))", 1},
+}
+
+func TestMinRemovedParens(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := MinRemovedParens(tc.input); result != tc.expected {
+			t.Errorf("Expected %v got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkMinRemovedParens(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			MinRemovedParens(tc.input)
+		}
+	}
+}
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 154
Good morning! Here's your coding interview problem for today.

This problem was asked by Amazon.

Implement a stack API using only a heap. A stack implements the following methods:

`push(item)`, which adds an element to the stack
`pop()`, which removes and returns the most recently added element (or throws an error if there is nothing on the stack)
Recall that a heap has the following operations:

`push(item)`, which adds a new key to the heap
`pop()`, which removes and returns the max value of the heap

Pull request:
Day154
Resolves #320.

Patch:
diff --git a/README.md b/README.md
index 829912a..6c43ed4 100644
--- a/README.md
+++ b/README.md
@@ -163,3 +163,4 @@ problems from
 * [Day 150](https://github.com/vaskoz/dailycodingproblem-go/issues/312)
 * [Day 151](https://github.com/vaskoz/dailycodingproblem-go/issues/313)
 * [Day 153](https://github.com/vaskoz/dailycodingproblem-go/issues/316)
+* [Day 154](https://github.com/vaskoz/dailycodingproblem-go/issues/320)
diff --git a/day154/problem.go b/day154/problem.go
new file mode 100644
index 0000000..a56c2c8
--- /dev/null
+++ b/day154/problem.go
@@ -0,0 +1,45 @@
+package day154
+
+import "container/heap"
+
+// StackHeap is a stack implemented using only a heap.
+// Runs in O(N log N) time.
+// Also contains a flaw with the counter due to overflow.
+type StackHeap struct {
+	heap    maxHeap
+	counter uint64
+}
+
+type item struct {
+	index uint64
+	value interface{}
+}
+
+type maxHeap []item
+
+func (h maxHeap) Len() int           { return len(h) }
+func (h maxHeap) Less(i, j int) bool { return h[i].index > h[j].index }
+func (h maxHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }
+
+func (h *maxHeap) Push(x interface{}) {
+	*h = append(*h, x.(item))
+}
+
+func (h *maxHeap) Pop() interface{} {
+	old := *h
+	n := len(old)
+	x := old[n-1].value
+	*h = old[:n-1]
+	return x
+}
+
+// Push adds an element to the stack.
+func (sh *StackHeap) Push(v interface{}) {
+	heap.Push(&sh.heap, item{sh.counter, v})
+	sh.counter++
+}
+
+// Pop removes an element from the stack.
+func (sh *StackHeap) Pop() interface{} {
+	return heap.Pop(&sh.heap)
+}


Test patch:
diff --git a/day154/problem_test.go b/day154/problem_test.go
new file mode 100644
index 0000000..80ea6c1
--- /dev/null
+++ b/day154/problem_test.go
@@ -0,0 +1,39 @@
+package day154
+
+import "testing"
+
+var testcases = []struct {
+	items []interface{}
+}{
+	{[]interface{}{"foo", "bar", 1, 3, 5}},
+	{[]interface{}{10, 20, 30, 15, 30, 55}},
+}
+
+func TestStackHeap(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		var stack StackHeap
+		for i := range tc.items {
+			stack.Push(tc.items[i])
+		}
+		for i := range tc.items {
+			if result := stack.Pop(); result != tc.items[len(tc.items)-1-i] {
+				t.Errorf("Expected %v got %v", tc.items[len(tc.items)-1-i], result)
+			}
+		}
+	}
+}
+
+func BenchmarkStackHeap(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			var stack StackHeap
+			for i := range tc.items {
+				stack.Push(tc.items[i])
+			}
+			for range tc.items {
+				stack.Pop()
+			}
+		}
+	}
+}
Repository: Aleph-Alpha/ts-rs (rust)

Issue:
bug: `rename_all` cannot be used with unit or tuple structs
**Describe the bug**
AFAICT this is the same as #403, but it's still present in 11.0.1 (the fix for that was merged before 11.0.0 afaict).

**To Reproduce**
```
#[derive(Serialize, Deserialize, Clone, Debug, Hash, JsonSchema, TS, PartialEq, Eq, PartialOrd, Ord)]
#[serde(rename_all = "snake_case", deny_unknown_fields)]
pub struct ViewId(pub String);
```

I'm getting it with this struct atm.

Pull request:
Make `rename_all` compatible with tuple and unit structs as a no-op attribute
## Goal

Make `#[ts(rename_all = "...")]` compatible with tuple and unit structs and make it a no-op in such cases. This behavior matches how `serde` works by not causing a compiler error, and just not doing anything instead.
Closes #421

## Changes

Removed a check from `StructAttr::assert_validity`

## Checklist

- [x] I have followed the steps listed in the [Contributing guide](https://github.com/Aleph-Alpha/ts-rs/blob/main/CONTRIBUTING.md).
- [x] If necessary, I have added documentation related to the changes made.
- [x] I have added or updated the tests related to the changes made.


Patch:
diff --git a/macros/src/attr/struct.rs b/macros/src/attr/struct.rs
index f9f0f27..aaebeff 100644
--- a/macros/src/attr/struct.rs
+++ b/macros/src/attr/struct.rs
@@ -132,10 +132,6 @@ impl Attr for StructAttr {
             if self.tag.is_some() {
                 syn_err!("`tag` cannot be used with unit or tuple structs");
             }
-
-            if self.rename_all.is_some() {
-                syn_err!("`rename_all` cannot be used with unit or tuple structs");
-            }
         }
 
         Ok(())


Test patch:
diff --git a/ts-rs/tests/integration/tuple.rs b/ts-rs/tests/integration/tuple.rs
index 9d85c91..a30ba00 100644
--- a/ts-rs/tests/integration/tuple.rs
+++ b/ts-rs/tests/integration/tuple.rs
@@ -24,7 +24,7 @@ fn test_newtype() {
 }
 
 #[derive(TS)]
-#[ts(export, export_to = "tuple/")]
+#[ts(export, export_to = "tuple/", rename_all = "camelCase")] // rename_all should compile, but it's a noop
 struct TupleNewType(String, i32, (i32, i32));
 
 #[test]
@@ -36,7 +36,7 @@ fn test_tuple_newtype() {
 }
 
 #[derive(TS)]
-#[ts(export, export_to = "tuple/")]
+#[ts(export, export_to = "tuple/", rename_all = "kebab-case")]
 struct Dep1;
 
 #[derive(TS)]
Repository: tweag/nickel (rust)

Issue:
Enum variants don't merge even if they were the same
**Describe the bug**
Enum variants don't merge even if they were the same.

**To Reproduce**
```
nickel> `A & `A
error: Non mergeable terms
  ┌─ repl-input-1:1:1
  │
1 │ `A & `A
  │ ^^---^^
  │ │    │
  │ │    with this expression
  │ merged here
  │ cannot merge this expression
```

**Expected behavior**
It should result in
```
`A
```

**Environment**
 - OS name + version: `Linux xps 5.10.89-1-MANJARO #1 SMP PREEMPT Wed Dec 29 18:09:17 UTC 2021 x86_64 GNU/Linux`
 - Version of the code: a48713d

**Additional context**
I came across the issue when I applied the same contract (which specifies default enum variant) twice, something like
```
let T = {a | <A, B> | default = `A } & {a = `A} in {} | #T | #T
```

Pull request:
Merge enum variants properly
Resolves #590

Patch:
diff --git a/src/eval/merge.rs b/src/eval/merge.rs
index 231265e9..8c859da0 100644
--- a/src/eval/merge.rs
+++ b/src/eval/merge.rs
@@ -199,6 +199,26 @@ pub fn merge(
                 ))
             }
         }
+        (Term::Enum(i1), Term::Enum(i2)) => {
+            if i1 == i2 {
+                Ok(Closure::atomic_closure(RichTerm::new(
+                    Term::Enum(i1),
+                    pos_op.into_inherited(),
+                )))
+            } else {
+                Err(EvalError::MergeIncompatibleArgs(
+                    RichTerm {
+                        term: SharedTerm::new(Term::Enum(i1)),
+                        pos: pos1,
+                    },
+                    RichTerm {
+                        term: SharedTerm::new(Term::Enum(i2)),
+                        pos: pos2,
+                    },
+                    pos_op,
+                ))
+            }
+        }
         (Term::MetaValue(meta1), Term::MetaValue(meta2)) => {
             // For now, we blindly closurize things and copy environments in this section. A
             // careful analysis would make it possible to spare a few closurize operations and more


Test patch:
diff --git a/tests/pass/records.ncl b/tests/pass/records.ncl
index d43da72b..ae957a88 100644
--- a/tests/pass/records.ncl
+++ b/tests/pass/records.ncl
@@ -37,6 +37,9 @@ let Assert = fun l x => x || %blame% l in
   {a = {b = 1}} & {a = {c = true}}
     == {a = {b = 1, c = true}},
 
+  {a = `A, b = `B} & {a = `A, c = `C}
+    == {a = `A, b = `B, c = `C},
+
   // merge_complex
   let rec1 = {
       a = false,
Repository: typedorm/typedorm (ts)

Issue:
"false" value is parsed as a non-scalar value
Currently [isScalarType](https://github.com/typedorm/typedorm/blob/main/packages/core/src/helpers/is-scalar-type.ts#L3) function incorrectly detects `false` as a non-scalar value and it fails expression parsing. 

Example of condition:

```typescript
{
    where: {
      AND: {
        NOT: {
          id: { IN: ids },
        },
        used: { EQ: false },
      },
    },
}
```

Pull request:
fix(core): correctly detect scalar types
This MR fixes #171

I've decided to remove `item &&` check because it filters valid values such as `false` or `0`.

Added tests.

Patch:
diff --git a/packages/core/src/helpers/is-scalar-type.ts b/packages/core/src/helpers/is-scalar-type.ts
index d7a06b6..a92b5fb 100644
--- a/packages/core/src/helpers/is-scalar-type.ts
+++ b/packages/core/src/helpers/is-scalar-type.ts
@@ -1,11 +1,10 @@
 import {ScalarType} from '@typedorm/common';
 
 export const isScalarType = (item: any): item is ScalarType =>
-  item &&
-  (typeof item === 'string' ||
-    typeof item === 'number' ||
-    typeof item === 'boolean' ||
-    Buffer.isBuffer(item));
+  typeof item === 'string' ||
+  (typeof item === 'number' && !isNaN(item)) ||
+  typeof item === 'boolean' ||
+  Buffer.isBuffer(item);
 
 export const isScalarTypeProvider = (item: any): item is () => ScalarType =>
   item && typeof item === 'function';


Test patch:
diff --git a/packages/core/src/helpers/__test__/is-scalar-type.spec.ts b/packages/core/src/helpers/__test__/is-scalar-type.spec.ts
new file mode 100644
index 0000000..d0452de
--- /dev/null
+++ b/packages/core/src/helpers/__test__/is-scalar-type.spec.ts
@@ -0,0 +1,33 @@
+import {isScalarType} from '../is-scalar-type';
+
+test('checks if isScalarType return true for scalar values', () => {
+  const scalarValues = ['string', 1, true, Buffer.from([0])];
+
+  for (const scalarValue of scalarValues) {
+    expect(isScalarType(scalarValue)).toBeTruthy();
+  }
+});
+
+test('checks if isScalarType return true for "empty" scalar values', () => {
+  const scalarValues = ['', 0, false, Buffer.from([])];
+
+  for (const scalarValue of scalarValues) {
+    expect(isScalarType(scalarValue)).toBeTruthy();
+  }
+});
+
+test('checks if isScalarType return false for non-scalar types', () => {
+  const nonScalarValues = [
+    {},
+    [],
+    null,
+    undefined,
+    NaN,
+    new Function(),
+    new Map(),
+  ];
+
+  for (const nonScalarValue of nonScalarValues) {
+    expect(isScalarType(nonScalarValue)).toBeFalsy();
+  }
+});