Skip to content

Prep repo for next release #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
run: |
npm install -g bower
npm install
bower info purescript-node-buffer --verbose
bower install --production

- name: Build source
Expand All @@ -35,7 +36,7 @@ jobs:
bower install
npx pulp test
npx pulp test --main Test.Main1
npx pulp test --main Test.Main2 | wc -c
npx pulp test --main Test.Main2
npx pulp test --main Test.Main3 -- <(head --bytes 1000000 /dev/zero)
npx pulp test --main Test.Main4

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ Other improvements:
- Updated FFI to use uncurried functions (#50 by @JordanMartinez)
- Relocated `setEncoding`, `Read`, and `Write` for better locality in docs (#51 by @JordanMartinez)
- Added `node-streams-aff` tests (#52 by @JordanMartinez)
- Updated `spec` to `v7.5.3` to address `bower` dep issue (#54 by @JordanMartinez)

See https://github.com/purescript-spec/purescript-spec/pull/142 for more context.

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

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

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

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"purescript-assert": "^6.0.0",
"purescript-console": "^6.0.0",
"purescript-partial": "^4.0.0",
"purescript-spec": "^7.3.0"
"purescript-spec": "^7.5.3"
},
"dependencies": {
"purescript-effect": "^4.0.0",
Expand Down
3 changes: 0 additions & 3 deletions test/Main2.js

This file was deleted.

32 changes: 18 additions & 14 deletions test/Main2.purs
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
-- | How to test:
-- |
-- | ```
-- | pulp test --main Test.Main2 | wc -c
-- | pulp test --main Test.Main2
-- | ```
module Test.Main2 where

import Prelude

import Data.Array as Array
import Data.Either (Either(..))
import Data.String (Pattern(..))
import Data.String as String
import Effect (Effect)
import Effect.Aff (Error, runAff_)
import Effect.Aff (Error, error, runAff_, throwError)
import Effect.Class (liftEffect)
import Effect.Class.Console as Console
import Node.Buffer as Buffer
import Node.Encoding (Encoding(..))
import Node.Stream (Writable)
import Node.Stream.Aff (write)
import Partial.Unsafe (unsafePartial)
import Node.Stream (newPassThrough)
import Node.Stream.Aff (readableToStringUtf8, write)
import Unsafe.Coerce (unsafeCoerce)

foreign import stdout :: Writable ()

completion :: Either Error (Effect Unit) -> Effect Unit
completion :: Either Error Unit -> Effect Unit
completion = case _ of
Left e -> Console.error (unsafeCoerce e)
Right f -> f
Right _ -> mempty

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