Skip to content

Commit 1e15a3f

Browse files
Prep repo for next release (#54)
* Update contributors in license * Refactor: verify line count test is correct * Update spec to fix bower dep issue
1 parent 684041e commit 1e15a3f

File tree

6 files changed

+25
-20
lines changed

6 files changed

+25
-20
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
run: |
2626
npm install -g bower
2727
npm install
28+
bower info purescript-node-buffer --verbose
2829
bower install --production
2930
3031
- name: Build source
@@ -35,7 +36,7 @@ jobs:
3536
bower install
3637
npx pulp test
3738
npx pulp test --main Test.Main1
38-
npx pulp test --main Test.Main2 | wc -c
39+
npx pulp test --main Test.Main2
3940
npx pulp test --main Test.Main3 -- <(head --bytes 1000000 /dev/zero)
4041
npx pulp test --main Test.Main4
4142

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ Other improvements:
8787
- Updated FFI to use uncurried functions (#50 by @JordanMartinez)
8888
- Relocated `setEncoding`, `Read`, and `Write` for better locality in docs (#51 by @JordanMartinez)
8989
- Added `node-streams-aff` tests (#52 by @JordanMartinez)
90+
- Updated `spec` to `v7.5.3` to address `bower` dep issue (#54 by @JordanMartinez)
91+
92+
See https://github.com/purescript-spec/purescript-spec/pull/142 for more context.
9093

9194
## [v7.0.0](https://github.com/purescript-node/purescript-node-streams/releases/tag/v7.0.0) - 2022-04-29
9295

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 DICOM Grid, Inc.
3+
Copyright (c) 2015 DICOM Grid, Inc., `purescript-node` contributors, and James Dawson Brock
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"purescript-assert": "^6.0.0",
1616
"purescript-console": "^6.0.0",
1717
"purescript-partial": "^4.0.0",
18-
"purescript-spec": "^7.3.0"
18+
"purescript-spec": "^7.5.3"
1919
},
2020
"dependencies": {
2121
"purescript-effect": "^4.0.0",

test/Main2.js

-3
This file was deleted.

test/Main2.purs

+18-14
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
-- | How to test:
22
-- |
33
-- | ```
4-
-- | pulp test --main Test.Main2 | wc -c
4+
-- | pulp test --main Test.Main2
55
-- | ```
66
module Test.Main2 where
77

88
import Prelude
99

1010
import Data.Array as Array
1111
import Data.Either (Either(..))
12+
import Data.String (Pattern(..))
13+
import Data.String as String
1214
import Effect (Effect)
13-
import Effect.Aff (Error, runAff_)
15+
import Effect.Aff (Error, error, runAff_, throwError)
1416
import Effect.Class (liftEffect)
1517
import Effect.Class.Console as Console
1618
import Node.Buffer as Buffer
1719
import Node.Encoding (Encoding(..))
18-
import Node.Stream (Writable)
19-
import Node.Stream.Aff (write)
20-
import Partial.Unsafe (unsafePartial)
20+
import Node.Stream (newPassThrough)
21+
import Node.Stream.Aff (readableToStringUtf8, write)
2122
import Unsafe.Coerce (unsafeCoerce)
2223

23-
foreign import stdout :: Writable ()
24-
25-
completion :: Either Error (Effect Unit) -> Effect Unit
24+
completion :: Either Error Unit -> Effect Unit
2625
completion = case _ of
2726
Left e -> Console.error (unsafeCoerce e)
28-
Right f -> f
27+
Right _ -> mempty
2928

3029
main :: Effect Unit
31-
main = unsafePartial $ do
30+
main = do
31+
duplex <- newPassThrough
3232
runAff_ completion do
33-
do
34-
b <- liftEffect $ Buffer.fromString "aaaaaaaaaa" UTF8
35-
write stdout $ Array.replicate 100000 b
36-
pure (pure unit)
33+
let expected = 100_000
34+
b <- liftEffect $ Buffer.fromString "aaaaaaaaaa" UTF8
35+
write duplex $ Array.replicate 100000 b
36+
str <- readableToStringUtf8 duplex
37+
let actual = Array.length (String.split (Pattern "\n") str)
38+
unless (expected == expected) do
39+
throwError $ error $ "Expected " <> show expected <> " lines, but got " <> show actual <> " lines."
40+

0 commit comments

Comments
 (0)